Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 371107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:04:58+00:00 2026-05-12T14:04:58+00:00

I need to handle when the user restores the form by double clicking the

  • 0

I need to handle when the user restores the form by double clicking the title bar. I tried handling the WM_SYSCOMMAND window message however this only works if the user restores the form via clicking the restore button in the system menu.

I am using DevExpress ribbon form components if this matters.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:04:58+00:00Added an answer on May 12, 2026 at 2:04 pm

    I think you mean double-clicking on the title bar because double clicking on the system menu closes the form.
    WM_SYSCOMMAND should work since the sequence of messages when double-clicking on the title bar to restore the form is:

    Message posted: hwnd=$004E0820 WM_NCLBUTTONDBLCLK wParam $00000002 lParam $000705D4 Process Project1.exe (2380)
    => Message sent: hwnd=$004E0820 WM_SYSCOMMAND restore cmd requested (-44,-44) Process Project1.exe (2380)
    Message sent: hwnd=$004E0820 WM_WINDOWPOSCHANGING wParam $00000000 lParam $0012F4CC Process Project1.exe (2380)
    Message sent: hwnd=$004E0820 WM_GETMINMAXINFO wParam $00000000 lParam $0012EF6C Process Project1.exe (2380)
    Message sent: hwnd=$004E0820 WM_NCCALCSIZE wParam $00000001 lParam $0012F4A0 Process Project1.exe (2380)
    Message sent: hwnd=$004E0820 WM_NCPAINT update region  40040F4B Process Project1.exe (2380)
    Message sent: hwnd=$004E0820 WM_ERASEBKGND wParam $31011DCA lParam $00000000 Process Project1.exe (2380)
    Message sent: hwnd=$004E0820 WM_WINDOWPOSCHANGED wParam $00000000 lParam $0012F4CC Process Project1.exe (2380)
    

    The problem is that the CmdType const SC_RESTORE2 = 61730 //0xF122 is missing in Windows.pas.

    See the working code below:

    type
      TForm7 = class(TForm)
      private
        procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
      end;
    
    var
      Form7: TForm7;
    
    implementation
    
    {$R *.dfm}
    
    { TForm7 }
    
    const
      SC_RESTORE2 = 61730; //0xF122
    
    procedure TForm7.WMSysCommand(var Message: TWMSysCommand);
    begin
      case Message.CmdType of
        SC_RESTORE2 : beep;
      end;
      inherited;
    end;
    

    Update: reference to SC_RESTORE2 from WM_SYSCOMMAND Notification on MSDN (see the “values in C#” part)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQuery grid with data with user data. I need to handle
I need to handle home button pressing in my app. When user presses home
We need to handle this event in the base form, regardless of which controls
I need to handle the case when a user clicks on a mapTypeControl differently
How can i handle user inputs with textarea, i need to strip user entered
I need to handle events of two different types but I'm running into the
I need to handle strings in my php script using regular expressions. But there
For a project I need to handle audio in an iPhone app quite special
I'm writing a batch (.bat) script and I need to handle the case in
I have a problem with NCurses ... i need to handle all keys like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.