473,468 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 14255
"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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.