News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

[ASK] Window without caption?

Started by godiest, August 16, 2011, 08:38:11 AM

Previous topic - Next topic

godiest

I want to create window without caption, but how could I move this window if there is no caption?

jj2007

Test the attached exe by pressing cursor left, right etc, and search the *.asm for IdUp

godiest

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?


jj2007

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.

Ramon Sala

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.
Greetings from Catalonia

godiest

Okay, I know the direction now, thanks guys. :)