473,396 Members | 1,703 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,396 software developers and data experts.

Window Proc

Kindly i want to know how to use window proc from within C# Application
is there any tutorial or somebody can help me in doing this
Nov 17 '05 #1
2 2299
Hi man,
in each form:
protected override void WndProc(ref Message m)

{

//Exit Message Code

int WM_QUERYENDSESSION = 0x11;

//Cancel Message Code

int WM_CANCELMODE = 0x1F;

// if the message is to shut down/reset window

if (m.Msg == WM_QUERYENDSESSION)

{

base.WndProc(ref m);

//You can also cancel the exit window message by using

//the following lines

//Message MyMessage = new Message();

//MyMessage.Msg = Convert.ToInt32(WM_CANCELMODE);

//base.WndProc(ref MyMessage);

}

else

{

//carry on with the message

base.WndProc(ref m);

}

}

hope that helps.

"Just close your eyes and see"
<Ju*********************@discussions.microsoft.com > wrote in message
news:02**********************************@microsof t.com...
Kindly i want to know how to use window proc from within C# Application
is there any tutorial or somebody can help me in doing this

Nov 17 '05 #2
Hi,

Use it only if you know what you are doing, otherwise use the event handling
provided by the framework.

All you have to do is overwrite WndProc ,Take a look at Control.WndProc in
MSDN
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Just close your eyes and see"
<Ju*********************@discussions.microsoft.com > wrote in message
news:02**********************************@microsof t.com...
Kindly i want to know how to use window proc from within C# Application
is there any tutorial or somebody can help me in doing this

Nov 17 '05 #3

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

Similar topics

5
by: VR | last post by:
Hi, How can I open a web site in a new browser window from a regular windows form? (not an ASP.NET) Do I have to use a COM ActiveX control or is there anything like that already built in in...
8
by: Mészáros Tamás | last post by:
Hi all, how can I set an app's main window to visible from an other application? My problem is, that I know only the handle of the other app's main process, because the application's main window...
14
by: | last post by:
Hi All, I am little confused here, hope you can help me. While processing WM_POWERBROADCAST (wParam=PBT_APMQUERYSUSPEND), I MUST to do some lengthy operation(30 sec) before system Suspends or...
0
by: pavan377 | last post by:
Hi folks, I got a requirement in my project where in when my application is activated another window should get activated and upon it my application should be present. Both should be in restored...
3
by: harvie wang | last post by:
Hi, I create a system mouse hook, to get mouse position and click events. use GetDesktopWiindow and WindowFromPoint(x,y) to get window handle in my hook proc. Click mouse on desktop window and...
9
by: =?Utf-8?B?UG90c2FuZw==?= | last post by:
Hi, I have a window service program created in c#. The window service program is installed and running. In the mean time, I have another c# application, I would like to know if there is a way to...
1
by: =?Utf-8?B?U3JpbWFu?= | last post by:
We are trying to bring the window on top if its already running(Restore). The code works fine 90% of the time but sometimes it does not. The reason it does not work at times is coz the window...
10
by: Gary | last post by:
I'm trying to find a way to determin which window Within-Another-Program currently has the focus. THE SITUATION: (Skip down to "My Question" if you don't want the background...) * This is...
4
by: =?Utf-8?B?SHVleQ==?= | last post by:
I need to hide the new window started from the code below. If I run as is, the window is visible. If I comment out the code that sets a different user, domain, and password the window is hidden...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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
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,...

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.