Click here to Skip to main content
15,899,313 members
Home / Discussions / C#
   

C#

 
GeneralLooping Problem. Pin
Steve McLenithan2-Dec-02 19:59
Steve McLenithan2-Dec-02 19:59 
GeneralRe: Looping Problem. Pin
Steve McLenithan2-Dec-02 20:01
Steve McLenithan2-Dec-02 20:01 
GeneralRe: Looping Problem. Pin
Daniel Turini2-Dec-02 22:14
Daniel Turini2-Dec-02 22:14 
GeneralRichTextBox Scrollbar Pin
ragear2-Dec-02 16:30
ragear2-Dec-02 16:30 
GeneralRe: RichTextBox Scrollbar Pin
leppie3-Dec-02 1:17
leppie3-Dec-02 1:17 
GeneralRe: RichTextBox Scrollbar Pin
ragear3-Dec-02 14:55
ragear3-Dec-02 14:55 
GeneralSome Bugs While Running C# Application On Win98 Pin
yccheok2-Dec-02 14:16
yccheok2-Dec-02 14:16 
GeneralRe: Some Bugs While Running C# Application On Win98 Pin
Jeff J3-Dec-02 16:20
Jeff J3-Dec-02 16:20 
1) The message you want to catch is not normally exposed by .Net. Clicking on the minimize button, or by using shortcut keys, etc., sends a WM_SYSCOMMAND message to the form's window, along with a command value of SC_MINIMIZE. There is a way to capture these messages, however, so you can really polish your app.

In your app's constructor, add:

this.SetStyle(ControlStyles.EnableNotifyMessage, true);

That will allow you to override the OnNotifyMessage() function, which catches all window messages. So add to your app's methods:

protected override void OnNotifyMessage(Message msg) {<br />
<br />
   if (msg.Msg == 0x0112  &&          //WM_SYSCOMMAND<br />
       (uint)msg.WParam == 0xF020) {  //SC_MINIMIZE<br />
<br />
      MessageBox.Show("Minimize activated");<br />
   }<br />
}


I'm fairly sure that no matter what platform you run on, the message box will fire on any minimise event. That includes minimising from the taskbar, or any other means. Of course, you'll want to replace the message box with your form-hiding code. No other event will falsely trigger minimising either.

Cheers
GeneralRe: Some Bugs While Running C# Application On Win98 Pin
yccheok3-Dec-02 16:43
yccheok3-Dec-02 16:43 
GeneralRe: Some Bugs While Running C# Application On Win98 Pin
Nick Parker3-Dec-02 16:49
protectorNick Parker3-Dec-02 16:49 
GeneralRe: Some Bugs While Running C# Application On Win98 Pin
James T. Johnson3-Dec-02 16:59
James T. Johnson3-Dec-02 16:59 
GeneralRe: Some Bugs While Running C# Application On Win98 Pin
Nick Parker3-Dec-02 18:17
protectorNick Parker3-Dec-02 18:17 
GeneralRe: Some Bugs While Running C# Application On Win98 Pin
Jeff J3-Dec-02 20:37
Jeff J3-Dec-02 20:37 
GeneralCom interop Pin
grv5752-Dec-02 14:07
grv5752-Dec-02 14:07 
GeneralRe: Com interop Pin
James T. Johnson2-Dec-02 14:16
James T. Johnson2-Dec-02 14:16 
GeneralRe: Com interop Pin
grv5752-Dec-02 15:28
grv5752-Dec-02 15:28 
GeneralRe: Com interop Pin
James T. Johnson2-Dec-02 15:38
James T. Johnson2-Dec-02 15:38 
GeneralRe: Com interop Pin
grv5752-Dec-02 16:14
grv5752-Dec-02 16:14 
GeneralRe: Com interop Pin
James T. Johnson2-Dec-02 16:41
James T. Johnson2-Dec-02 16:41 
GeneralRe: Com interop Pin
grv5755-Dec-02 1:58
grv5755-Dec-02 1:58 
QuestionHow to detect account without a password Pin
Ingram Leedy2-Dec-02 12:13
Ingram Leedy2-Dec-02 12:13 
GeneralIcon depth and sizes under .Net Pin
FruitBatInShades2-Dec-02 12:05
FruitBatInShades2-Dec-02 12:05 
GeneralDatagrid IN a Datalist Pin
tidge2-Dec-02 10:20
tidge2-Dec-02 10:20 
QuestionProtect the MSIL code? Pin
Rickard Andersson202-Dec-02 7:51
Rickard Andersson202-Dec-02 7:51 
AnswerRe: Protect the MSIL code? Pin
leppie2-Dec-02 8:20
leppie2-Dec-02 8:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.