Solved

Windows Message when get maximize ot restore

Posted on 2004-08-02
5
213 Views
Last Modified: 2013-11-20
Hello
What the message will window send when it get maximize or restore on nonclient area of the Window.If we do it on client window that time it will send WM_GETMINMAXINFO.But I am not getting the message when it maximize or restore on non client window.CAn any one help me.
Regards
0
Comment
Question by:nclgaurav
  • 3
5 Comments
 
LVL 16

Expert Comment

by:kiranvj
ID: 11691454
hi...

paste this code in your OnSysCommand function

if ((nID & 0xFFF0) == SC_MAXIMIZE)
            AfxMessageBox("Maximised")

if ((nID & 0xFFF0) == SC_RESTORE)
            AfxMessageBox("Restored")      

if ((nID & 0xFFF0) == SC_MINIMIZE)
            AfxMessageBox("Minimised");


hope this helps

kiranvj
0
 

Author Comment

by:nclgaurav
ID: 11691960
Actually this is a Win32 Application.Here I am hooking the mouse and keyboard.So wat I have to .
0
 
LVL 16

Accepted Solution

by:
kiranvj earned 50 total points
ID: 11692371
try this

in function  WindowProc(.......    , write


if(message == WM_SYSCOMMAND && wParam == SC_MINIMIZE)
            MessageBox("Minimised");

if(message == WM_SYSCOMMAND && wParam == SC_MAXIMIZE)
            MessageBox("Maximised");
      
if(message == WM_SYSCOMMAND && wParam == SC_RESTORE)
            MessageBox("Restore");

where message is the message identifier.

kiranvj
0
 
LVL 16

Expert Comment

by:kiranvj
ID: 12017032
hi, DanRollins

i think i deserve some points.... ;-)

kiranvj
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now