Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

windowsx.h? Never seen before!

560 views
Skip to first unread message

lop...@my-deja.com

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
Hi,
today I found out, that there is windowsx.h in WIN API. I had never
seen this header file and any functions defined in it before. So I
tried, of course, to look in MSDN, but I couldn't find anything about
this file and functions it supports. For example I was looking for
HANDLE_MSG macro, which is defined in windowsx.h.
Can anyone help me and tell where can I find these information??
Thanks a lot!

--

Best Regards,
Hynek Cihlar


Sent via Deja.com http://www.deja.com/
Before you buy.

Chris Becke

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
<lop...@my-deja.com> wrote:
> Hi,
> today I found out, that there is windowsx.h in WIN API. I had never
> seen this header file and any functions defined in it before. So I
> tried, of course, to look in MSDN, but I couldn't find anything about
> this file and functions it supports. For example I was looking for
> HANDLE_MSG macro, which is defined in windowsx.h.
> Can anyone help me and tell where can I find these information??
> Thanks a lot!

I don't belive there is much in the way of official documentation for this
file. It does have a number of helpfull macros, one can only determine their
usage by examining the windowsx.h file and making an educated guess.

Chris
--
VisualC++ & Win32 FAQ: http://www.mvps.org/vcfaq
My Win32 Page: http://www.mvps.org/user32


Djc2000

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
Windowsx.h has lots of cool unknown stuff in it. Message crackers are one
which you are talking about, but there also child control macros and useful
macros to reduce the amount of casting that you have to use a standard Win32
application. Cool stuff!

For lots of info, search for message crackers and win32 on the net, or buy
these books

Advanced Windows 3rd Ed by J Richter (95 and NT 4)
or his newer Advanced Windows Programming for Win2000

Message Crackers allow you to split up callback procedures. switch case
statements can get ridiculously big so

HANDLE_MSG (hwnd, WM_COMMAND, Cls_On_Command) says if the procedure
recieves WM_COMMAND, then forward the message to a function called
Cls_On_Command in a really usefull format.

The prototypes for the functions the message gets redirected to are in
windowsx.h
Search for WM_COMMAND in windowsx.h and you will find this (maximise your
window now!)

/* void Cls_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) */
#define HANDLE_WM_COMMAND(hwnd, wParam, lParam, fn) \
((fn)((hwnd), (int)(LOWORD(wParam)), (HWND)(lParam),
(UINT)HIWORD(wParam)), 0L)
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
(void)(fn)((hwnd), WM_COMMAND,
MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))

All you need do is find this section for any command e.g WM_PAINT, search in
windowsx.h and get the prototype from above the #define HANDLE_?????????
and use this in your code instead!

Did I help?

Cheers,

Djc2000

<lop...@my-deja.com> wrote in message news:8f9lbg$mif$1...@nnrp1.deja.com...


> Hi,
> today I found out, that there is windowsx.h in WIN API. I had never
> seen this header file and any functions defined in it before. So I
> tried, of course, to look in MSDN, but I couldn't find anything about
> this file and functions it supports. For example I was looking for
> HANDLE_MSG macro, which is defined in windowsx.h.
> Can anyone help me and tell where can I find these information??
> Thanks a lot!
>

lop...@my-deja.com

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
Thanks Chris!

I thought si and I hoped I was wrong...
At least I can invest the time, otherwise spent looking for some
documentation, into examining the source files.

Djc2000

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
http://support.microsoft.com/support/kb/articles/q83/4/56.asp

Djc2000


<lop...@my-deja.com> wrote in message news:8f9lbg$mif$1...@nnrp1.deja.com...
> Hi,
> today I found out, that there is windowsx.h in WIN API. I had never
> seen this header file and any functions defined in it before. So I
> tried, of course, to look in MSDN, but I couldn't find anything about
> this file and functions it supports. For example I was looking for
> HANDLE_MSG macro, which is defined in windowsx.h.
> Can anyone help me and tell where can I find these information??
> Thanks a lot!
>
> --
>
> Best Regards,

Jerry Coffin

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
In article <8f9lbg$mif$1...@nnrp1.deja.com>, lop...@my-deja.com says...

> Hi,
> today I found out, that there is windowsx.h in WIN API. I had never
> seen this header file and any functions defined in it before. So I
> tried, of course, to look in MSDN, but I couldn't find anything about
> this file and functions it supports. For example I was looking for
> HANDLE_MSG macro, which is defined in windowsx.h.
> Can anyone help me and tell where can I find these information??

AFAIK, windowsx.h was first included with the Windows 3.1 SDK. It
was documented in a file named windowsx.txt that was included at the
time. MS has a KB article (Q83456) that provides a _little_ bit of
material about it, but not nearly as much as windowsx.txt did.
Unfortunately, while windowsx.h has been updated for Win32, it
doesn't look like windowsx.txt has received nearly as much (if any)
attention.

This is too bad, as windowsx.h has a lot of handy stuff and it works
quite nicely. When you get down to it, an awful lot of what people
associated with MFC is provided by windowsx.h. The biggest
difference is in the overhead; MFC's is a LOT higher.

--
Later,
Jerry.

The universe is a figment of its own imagination.

Hynek Cihlar

unread,
May 10, 2000, 3:00:00 AM5/10/00
to
Thank you so much!!
Really Helpful!

Sincerely,
Hynek Cihlar

In article <8fa36c$fe2$1...@uranium.btinternet.com>, dontb...@nospam.com
says...


> http://support.microsoft.com/support/kb/articles/q83/4/56.asp
>
> Djc2000
>
>
> <lop...@my-deja.com> wrote in message news:8f9lbg$mif$1...@nnrp1.deja.com...

> > Hi,
> > today I found out, that there is windowsx.h in WIN API. I had never
> > seen this header file and any functions defined in it before. So I
> > tried, of course, to look in MSDN, but I couldn't find anything about
> > this file and functions it supports. For example I was looking for
> > HANDLE_MSG macro, which is defined in windowsx.h.
> > Can anyone help me and tell where can I find these information??

rz

unread,
May 10, 2000, 3:00:00 AM5/10/00
to
Rector and Newcomer (_Win32 Programming_, Addison-Wesley, 1997) are fond of
the macros defined in windowsx.h and describe many. I found that once I
started using them, I had little trouble finding one I might find useful or
figuring out what one does.

--
-----------------------------------------
To reply to me, remove the underscores (_) from my email address.

Robert E. Zaret
PenFact, Inc.
20 Park Plaza, Suite 454
Boston, MA 02116
www.penfact.com

lop...@my-deja.com wrote in message <8f9lbg$mif$1...@nnrp1.deja.com>...

0 new messages