The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => Easy Code => Topic started by: godiest on August 16, 2011, 08:38:11 AM

Title: [ASK] Window without caption?
Post by: godiest on August 16, 2011, 08:38:11 AM
I want to create window without caption, but how could I move this window if there is no caption?
Title: Re: [ASK] Window without caption?
Post by: jj2007 on August 16, 2011, 09:28:49 AM
Test the attached exe by pressing cursor left, right etc, and search the *.asm for IdUp
Title: Re: [ASK] Window without caption?
Post by: godiest on August 16, 2011, 10:00:00 AM
I get error when open attached exe, "Sorry, MasmBasic needs SSE2".
For IdUp, the code only move window when spesific keys on keyboard pressed, right? I wanna move the window with my mouse, just like when I click and drag window's caption.

And I found a solution, I trap WM_LBUTTONDOWN message then use Invoke SendMessage, [hWnd], WM_NCLBUTTONDOWN, HTCAPTION, 0

BUT, I want my window moved also when I click and drag IMAGE object, and my application seems doesn't get WM_LBUTTONDOWN message when I click IMAGE object. Anyone know what WM sent to my application when I click IMAGE object?

Title: Re: [ASK] Window without caption?
Post by: jj2007 on August 16, 2011, 10:15:25 AM
Quote from: godiest on August 16, 2011, 10:00:00 AM
I get error when open attached exe, "Sorry, MasmBasic needs SSE2".

Interesting. Which CPU?
  db 0Fh, 0A2h ; cpuid 1
  bt edx, 26 ; edx bit 26, SSE2
  .if !Carry?
invoke MessageBox, 0, Chr$("Sorry, MasmBasic needs SSE2"), 0, MB_OK
invoke ExitProcess, -99
  .endif


You will need WM_LBUTTONDOWN or some other mechanism to start the move; then you can either poll the mouse position, or respond to WM_MOUSEMOVE. Subclassing may be required, but without full code posted, there is no way to know what you need.
Title: Re: [ASK] Window without caption?
Post by: Ramon Sala on August 16, 2011, 11:03:46 AM
Hi godiest,

For moving a window with no caption, you need to control the mouse messages in the client area (WM_LBUTTONDOWN, WM_MOUSEMOVE and WM_LBUTTONUP). You can have a look to the ECPlayer example (\EasyCode.Ms\Examples\ECPlayer), which is a window with no caption that can be moved.
Title: Re: [ASK] Window without caption?
Post by: godiest on August 16, 2011, 03:49:23 PM
Okay, I know the direction now, thanks guys. :)