Sorry i am kinda new to windows programming

Ok what i want to do is draw every thing on my window including the title bar pixel by pixel without using direct x as only one app can use that at a time or so i think.

If there was a way to get the actual Memory address of the window display area and write to it and update it as other windows and what not obscure it

Or the address to the screen itself, but i think this is the wrong approach for what i want

Ultimately i want to create my on app gui without using windows gui elements

Searched the forum for any leads to an answer before i posted but nothing seemed to relate

thanks please guide me in the direction i should take
Posted on 2006-08-01 15:51:43 by ChaosVisum
ChaosVisum,
In windows, you can't get a pointer to the screen, only in DirectX.

But you can use GDI and also the use of WM_PAINT WM_NCPAINT
ect couse you will need to draw not only on the client area but on
the Non-client areas as well.

Look at the GetWindowDC and CreateCompatibleDC,CreateCompatibleBitmap, and Bitblt.

Becouse you will have to draw your window using GDI functions
and you don't have to but you should draw it off screen by
creating a off screen DC using CreateCompatibleDC

Then create a blank bitmap using CreateCompatibleBitmap
then you select the blank bitmap into the offscreen DC, then you
can use GDI functions to draw on the bitmap that is in the DC

Then when your done you can bitblt the offscreen DC to the
window DC then clean up the offscreen OBJ's.

Zcoder....
Posted on 2006-08-01 16:07:34 by Zcoder
First easiest way is to simply use the WS_POPUP style to disable the titlebar - this is kind of bad because now you can't close your window and have to invent another way to close it !!

There's another way I found by accident when playing with window skinning code..
Use the CreateRectRgn apii function to create a 'rectangular region' which includes the titlebar.
Now you can use PaintRgn, FillRgn, etc to draw on top of the titlebar.

Have a nice day :)
Posted on 2006-08-02 01:24:26 by Homer
Annual thread revival day, eh? ;)
Posted on 2006-08-02 15:18:25 by f0dder
Thanks, i really appreciate your help
One day i am going to attribute my works to this community

Again you guys are awesome
Posted on 2006-08-02 19:34:13 by ChaosVisum
Ok so please help with this why cant i see my WS_POPUP windows
this is fasm code

;Starting here
format PE GUI 4.0
entry start

include '%fasminc%\win32a.inc'

section '.data' data readable writeable
    wHMain        dd  ?
    wHInstance    dd  ?

    wTitle        db  'NULL',0 ;name of our window
    wClsName      db  'TUT03',0      ;name of our window class

    wMsg      MSG
    wCls      WNDCLASS

section '.code' code readable executable
    start:
          ; +------------------------------+
          ; | registering the window class |
          ; +------------------------------+
          invoke    GetModuleHandle,NULL
                    mov  ,eax
                    mov  ,eax
                    mov  , WS_POPUP or CS_HREDRAW or CS_VREDRAW or WS_VISIBLE
                    mov  ,window_procedure
                    mov  ,wClsName
                    mov  ,COLOR_WINDOW+1
          invoke    LoadIcon,NULL,IDI_APPLICATION
                    mov  ,eax
          invoke    LoadCursor,NULL,IDC_ARROW
                    mov  ,eax
          invoke    RegisterClass,wCls

          ; +--------------------------+
          ; | creating the main window |
          ; +--------------------------+
          invoke    CreateWindowEx,\
                        0,\
                        wClsName,\
                        wTitle,\
                        WS_OVERLAPPEDWINDOW,\
                        CW_USEDEFAULT,\
                        CW_USEDEFAULT,\
                        CW_USEDEFAULT,\
                        CW_USEDEFAULT,\
                        NULL,\
                        NULL,\
                        ,\
                        NULL
                    mov  ,eax

          invoke    ShowWindow,,SW_SHOW
          invoke    SendMessage, , SW_SHOW, 1, 0
          ; +---------------------------+
          ; | entering the message loop |
          ; +---------------------------+
          window_message_loop_start:
              invoke    GetMessage,wMsg,NULL,0,0
                        or  eax,eax
                        je  window_message_loop_end
              invoke    TranslateMessage,wMsg
              invoke    DispatchMessage,wMsg
                        jmp  window_message_loop_start

          window_message_loop_end:
              invoke    ExitProcess,0

          ; +----------------------+
          ; | the window procedure |
          ; +----------------------+
          proc window_procedure,hWnd,uMsg,wParam,lParam
              push ebx esi edi    ;eventhough the API would preserved, but play safe :p
              cmp  ,WM_DESTROY
              je  wmDESTROY

              wmDEFAULT:
                    invoke    DefWindowProc,,,,
                              jmp  wmBYE
              wmDESTROY:
                    invoke    PostQuitMessage,0

              wmBYE:
                    pop  edi esi ebx
                    ret
          endp

section '.idata' import data readable writeable
    library  KERNEL32, 'KERNEL32.DLL',\
              USER32,  'USER32.DLL'

    import    KERNEL32,\
              GetModuleHandle,    'GetModuleHandleA',\
              ExitProcess,        'ExitProcess'

    import    USER32,\
              SendMessage,        'SendMessageA', \
              RegisterClass,      'RegisterClassA',\
              CreateWindowEx,    'CreateWindowExA',\
              DefWindowProc,      'DefWindowProcA',\
              ShowWindow,        'ShowWindow',\
              LoadCursor,        'LoadCursorA',\
              LoadIcon,          'LoadIconA',\
              GetMessage,        'GetMessageA',\
              TranslateMessage,  'TranslateMessage',\
              DispatchMessage,    'DispatchMessageA',\
              PostQuitMessage,    'PostQuitMessage'
Posted on 2006-08-04 17:11:23 by ChaosVisum
Remove the WS_POPUP and WS_VISIBLE styles from wCls.style and specify them as 4th parameter to CreateWindowEx.

...
                    mov  ,eax
                    mov  , CS_HREDRAW or CS_VREDRAW
                    mov  ,window_procedure
...

                    invoke    CreateWindowEx,\
                        0,\
                        wClsName,\
                        wTitle,\
                        WS_VISIBLE or WS_POPUP,\
...
Posted on 2006-08-04 17:31:10 by arafel
Ok as far as i know the WS_POPUP style gets rid of the title bar
in every possible combination of WS_POPUP, WS_VISIBLE, WS_OVERLAPPEDWINDOW i still get the title bar
example
invoke    CreateWindowEx,\
                        0,\
                        wClsName,\
                        wTitle,\
                        WS_POPUP or WS_OVERLAPPEDWINDOW,\
                        CW_USEDEFAULT,\
                        CW_USEDEFAULT,\ 
invoke    ShowWindow,,SW_SHOW

all this code does is turn my window into a collapsed version of itself (hieght, width = 0) in the upper left hand corner of the screen "with a title bar"

Posted on 2006-08-04 18:27:17 by ChaosVisum
Only WS_POPUP or WS_CISIBLE should be specified.
The reason you don't see any window is because of the CW_USEDEFAULT. If used along with WS_POPUP it sets the window dimensions to 0 - hence the "collapsed state"

Try somethin like:
                    invoke    CreateWindowEx,\
                        0,\
                        wClsName,\
                        wTitle,\
                        WS_POPUP or WS_VISIBLE,\
                        CW_USEDEFAULT,\
                        CW_USEDEFAULT,\
                        400,\
                        400,\
                        NULL,\
                        NULL,\
                        ,\
                        NULL
                    mov  ,eax
   
          invoke    ShowWindow,,SW_SHOW
Posted on 2006-08-04 18:47:37 by arafel
Awsome that worked thank you very much again you guys rock  :mrgreen:
Posted on 2006-08-05 18:45:34 by ChaosVisum