Author Topic: TIP - RegisterWindowMessage  (Read 3390 times)

0 Members and 1 Guest are viewing this topic.

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2459
  • Gender: Male
TIP - RegisterWindowMessage
« on: May 11, 2007, 04:34:52 PM »
Very few people know how to use RegisterWindowMessage. However this function is a real gem that would let you define a new window message that is guaranteed to be unique throughout the system.

The message value can be used when sending or posting messages.


NewMessageID = RegisterWindowMessage("TheMessageToBeRegistered")


You can use it to stop the nasty Windows notification popup when a CD or DVD is inserted in the tray.

Code: [Select]
NewMessageID = RegisterWindowMessageA("QueryCancelAutoplay")
CASE WM_QUERYCANCELAUTOPLAY '// Monitor DeviceNotification.
     FUNCTION = 1           '// Stop the notification popup
« Last Edit: May 11, 2007, 11:02:26 PM by Josť Roca »
Patrice Terrier
GDImage (advanced graphic addon)