flat assembler
Message board for the users of flat assembler.
Index
> Windows > Multiple questions |
Author |
|
Rookie 01 Oct 2004, 21:29
Hy!
I have a bunch of questions directed to anyone who can help, so I won't waste any more time and get to the point: 1) How do I remove an app from the taskbar? In Delphi I use a little trick, calling Code: ShowWindow(Application.Handle,SW_HIDE); when activating/deactivating,minimizing/maximizing/restoring and showing/hiding a form. I tried something similar in fasm: Code: proc WindowProc, hwnd,wmsg,wparam,lparam push ebx esi edi ... cmp [wmsg],WM_ACTIVATE je .wmactivate cmp [wmsg],WM_SHOWWINDOW je .wmshowwindow cmp [wmsg],WM_SYSCOMMAND je .wmsyscommand ... .defwndproc: invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] jmp .finish .wmactivate: .wmshowwindow: invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] invoke ShowWindow,[hinstance],SW_HIDE xor eax,eax jmp .finish .wmsyscommand: cmp [wparam],SC_MINIMIZE je .sc_minimize cmp [wparam],SC_MAXIMIZE je .sc_maximize cmp [wparam],SC_RESTORE je .sc_restore jmp .defwndproc .sc_minimize: .sc_maximize: .sc_restore: invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] invoke ShowWindow,[hinstance],SW_HIDE xor eax,eax jmp .finish ... .finish: pop edi esi ebx return but it doesn't work. 2) This is a DirectDraw question, with ddraw.inc provided by fasmw's examples. I did everything by the book: inited DirectDraw Code: invoke DirectDrawCreate,NULL,DDraw,NULL or eax,eax jnz .failed comcall DDraw,SetCooperativeLevel,[mainhwnd],DDSCL_NORMAL or eax,eax jnz .failed created a primary surface: Code: stdcall zeromem,DDSurfaceDesc,sizeof.DDSURFACEDESC mov [DDSurfaceDesc.dwSize],sizeof.DDSURFACEDESC mov [DDSurfaceDesc.dwFlags],DDSD_CAPS mov [DDSurfaceDesc.ddsCaps.dwCaps],DDSCAPS_PRIMARYSURFACE+DDSCAPS_VIDEOMEMORY comcall DDraw,CreateSurface,DDSurfaceDesc,DDSPrimary,NULL or eax,eax jnz .failed ; Create clipper comcall DDraw,CreateClipper,0,DDClipper,NULL or eax,eax jnz .failed comcall DDClipper,SetHWnd,0,[mainhwnd] or eax,eax jnz .failed comcall DDSPrimary,SetClipper,DDClipper or eax,eax jnz .failed and a back surface (for window drawing, not full screen): Code: ; Create back surface stdcall zeromem,DDSurfaceDesc,sizeof.DDSURFACEDESC mov [DDSurfaceDesc.dwSize],sizeof.DDSURFACEDESC mov [DDSurfaceDesc.dwFlags],DDSD_WIDTH+DDSD_HEIGHT+DDSD_CAPS push [width] pop [DDSurfaceDesc.dwWidth] push [height] pop [DDSurfaceDesc.dwHeight] mov [DDSurfaceDesc.ddsCaps.dwCaps],DDSCAPS_OFFSCREENPLAIN+DDSCAPS_VIDEOMEMORY comcall DDraw,CreateSurface,DDSurfaceDesc,DDSBack,NULL or eax,eax jnz .failed I then did some drawing on the back surface and tried to blit it: Code: comcall DDSPrimary,Blt,DestRect,[DDSBack],SrcRect,DDBLT_WAIT,NULL but this call causes an exception, the source of which I cannot identify (I compared with some Delphi sources and coulnd't find any difference, except for the syntax), then I looked at the example provided by fasmw (which is full screen, so there's a little bit of difference), and still couldn't see the problem. I'll spend some more time trying to solve this, but any help is greatly appreciated (I attached the full app source for those that are interested - the project is totally useless, started just for the pleasure (and practice) of fasming). That's it... I did say a 'bunch of questions' in the beginning, but I solved the others meanwhile.
_________________ This is who I choose to be. |
|||||||||||
01 Oct 2004, 21:29 |
|
Rookie 03 Oct 2004, 10:40
If I use [hwnd], it hides also the window itself. I need to remove just the app from the taskbar.
|
|||
03 Oct 2004, 10:40 |
|
farrier 03 Oct 2004, 22:03
Rookie,
Attached is a Radasm Project, done in MASM32 which does what you want for 1). If you or any one else translates this into FASM, post it here to help me with my mission to translate all my routines from MASM32 to FASM. Thanks to donkey for the original code! hth farrier
_________________ Some Assembly Required It's a good day to code! U.S.Constitution; Bill of Rights; Amendment 1: ... the right of the people peaceably to assemble, ... The code is dark, and full of errors! |
|||||||||||
03 Oct 2004, 22:03 |
|
Rookie 06 Oct 2004, 08:55
I promise to do so (at least for this one), but you'll have to wait a while, as I left home for university but left my computer behind for now. It'll take a couple of weeks before I settle myself in with computer and all. Then I'll get back to work. Promise.
_________________ This is who I choose to be. |
|||
06 Oct 2004, 08:55 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.