Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Windows Messages

Windows Messages

Scheduled Pinned Locked Moved C#
helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    T i T i
    wrote on last edited by
    #1

    Hi everybody, I'm asking for 2 things: 1-I want to know the equivelant Int value for some messages like WM_SETFOCUS , WM_ACTIVATEAPP ,..etc From where can I get information about messages like that? 2-After catching a message sent to my application by overriding WndProc(), Am I allowed to cancel or erase the effect of the received message? and how? for Example: (When the user presses on Maximize button, I don'twant the window to be maximized). thanks for Help

    R 1 Reply Last reply
    0
    • T T i T i

      Hi everybody, I'm asking for 2 things: 1-I want to know the equivelant Int value for some messages like WM_SETFOCUS , WM_ACTIVATEAPP ,..etc From where can I get information about messages like that? 2-After catching a message sent to my application by overriding WndProc(), Am I allowed to cancel or erase the effect of the received message? and how? for Example: (When the user presses on Maximize button, I don'twant the window to be maximized). thanks for Help

      R Offline
      R Offline
      Roman Rodov
      wrote on last edited by
      #2

      1. If you have Microsoft SDK look in the "include" directory for WinUser.h, it has ALL Windows messages defined there. If you don't have the SDK, either get it or Google for the message codes. If you have VB6 I think the API Viewer has the Windows messages as well. 2. You need to implement the IMessageFilter in some class and it's only method

      bool PreFilterMessage(ref Message msg)
      

      Check the message code in msg.Msg and return either 'true' if you want to cancel processing of this message and 'false' if you want to let it through to WndProc. If you want this filter application wide you can add this message filter like so:

      MyMessageFilter mf = new MyMessageFilter();
      Application.AddMessageFilter(mf);
      

      If you want to process this on just one window, just override the WndProc method. And do not call the base.WndProc after you process a message.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups