473,411 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

disable user moving application window?

I am using the following code to disable user to move my application in C++.
How to do it in C#?
Thanks.
void CMainFrame::OnSysCommand( UINT nID, LPARAM lParam )

{

if( (nID & 0xfff0) == SC_MOVE || (nID & 0xfff0) == SC_SIZE || (nID & 0xfff0)
== SC_RESTORE)

return;

CMDIFrameWnd::OnSysCommand(nID, lParam);

}
Nov 15 '05 #1
3 14240
"ST Choong" <st******@srm.com.my> wrote in
news:eh**************@TK2MSFTNGP10.phx.gbl:
I am using the following code to disable user to move my application
in C++. How to do it in C#?
Thanks.
void CMainFrame::OnSysCommand( UINT nID, LPARAM lParam )

{

if( (nID & 0xfff0) == SC_MOVE || (nID & 0xfff0) == SC_SIZE || (nID &
0xfff0) == SC_RESTORE)

return;

CMDIFrameWnd::OnSysCommand(nID, lParam);

}


Override your WndProc() procedure, and tjeck for the Message.Msg id-number

pseudo:

protected override WndProc(ref Message m) {
switch (m.Msg) {
case: 1:

return;
break;
}

base.WndProc(m);
}

/Pauli
Nov 15 '05 #2
"Pauli" <pauli-@-burningice-.-dk> wrote in message news:Xn*******************************@130.226.1.3 4...

Override your WndProc() procedure, and tjeck for the Message.Msg id-number


To make it a little clearer:

protected override void WndProc(ref Message message)
{
const int WM_SYSCOMMAND = 0x0112;
const int SC_MOVE = 0xF010;

switch(message.Msg)
{
case WM_SYSCOMMAND:
int command = message.WParam.ToInt32() & 0xfff0;
if (command == SC_MOVE)
return;
break;
}

base.WndProc(ref message);
}

Greetings,
timtos.
Nov 15 '05 #3
Thanks. I got it working.
"timtos" <ti****@gmx.de> wrote in message
news:bk**********@news.uni-koblenz.de...
"Pauli" <pauli-@-burningice-.-dk> wrote in message

news:Xn*******************************@130.226.1.3 4...

Override your WndProc() procedure, and tjeck for the Message.Msg id-number


To make it a little clearer:

protected override void WndProc(ref Message message)
{
const int WM_SYSCOMMAND = 0x0112;
const int SC_MOVE = 0xF010;

switch(message.Msg)
{
case WM_SYSCOMMAND:
int command = message.WParam.ToInt32() & 0xfff0;
if (command == SC_MOVE)
return;
break;
}

base.WndProc(ref message);
}

Greetings,
timtos.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: e | last post by:
Hello frineds, I need to move notepad.exe application window to the upper left corner to the screen with same size in my code. Anyone can help me how can i do this. I couldnt do this with...
0
by: lauren quantrell | last post by:
I have an Access 2000 application and I am using ShowWindow to hide the MS Access application window. Works fine as long as there is a popup form open all the time. The problem is when I want to...
3
by: Bob | last post by:
I am pretty new at C#, so bare with me. I want to be able to read a local HTML file and display it in a browser window within my application. I also want to submit that page to my application and...
4
by: Alexander Muylaert | last post by:
Hi How can I disable all user input? I would like to fully ignore all keyboard and mousevents. Is their a disabletaskwindows available or something likewise? kind regards Alexander
5
by: Wicksy | last post by:
Hi all. I have a VB.NET app with a loop running that is continually managing a number of threads AND updating a ListView object depending on the results of the worker threads. The problem I...
0
by: Shea | last post by:
Is there anyway to disable user controls being alive at design time? I have a user control which is throwing an exception in the constructor, and as such prevents me from loading my solution...
3
by: wavedave | last post by:
Hello everyone - I'm trying to build a .NET application (C#) in which my program acts as an add-on to another existing application, providing some additional functionality. The way I want the UI...
2
by: psbasha | last post by:
Hi, I have created a Graphical User Interface window using the Tkinter.The application takes three input files and ,it will process the data by creating the temporary files in the input file...
2
by: emlimeng | last post by:
Hi everyone It is maybe a questions asked many times. I am trying to limite users' access to Database Windows to improve security. I am working on an Access Data Project in Access 2000 format as...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.