flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Windows > gdi, get screenshot problem | 
| Author | 
 | 
| Mr_Silent 17 Mar 2007, 07:46 HORZRES       = 8
 VERTRES = 10 | |||
|  17 Mar 2007, 07:46 | 
 | 
| sleepsleep 17 Mar 2007, 07:56 lol @ myself    thanks mr_silent i think i got that value from google... without aware that it is not for windows         http://www.google.com/search?client=opera&rls=en&q=define+HORZRES&sourceid=opera&ie=utf-8&oe=utf-8 maybe somebody could check if i leak any gdi resource or not    | |||
|  17 Mar 2007, 07:56 | 
 | 
| sleepsleep 19 Mar 2007, 11:15 okie, i reupdate this code and make it a nice dll that able to be called from vb, (or etc language as u wish)
 file tabbed at 7 to use it from visual basic, just assembled the DLL then use the below code. Code: Private Declare Sub scan_window Lib "dscanner.dll" () Private Declare Sub set_bmpFileName Lib "dscanner.dll" (ByVal bmpFileName As String) Private Declare Sub set_scwH Lib "dscanner.dll" (ByVal windowhandle As Long) Private Sub Command1_Click() Dim k As String k = Text1.Text Call set_bmpFileName(k) Call set_scwH(Val(Text2.Text)) Call scan_window End Sub  
 
 | |||||||||||||||||||||
|  19 Mar 2007, 11:15 | 
 | 
| vid 19 Mar 2007, 12:12 sleepsleep: sorry, but i must repeate my favourite one:
 YOU SHOULD CHECK RETURN VALUES OF API CALLS!!!!!  | |||
|  19 Mar 2007, 12:12 | 
 | 
| asmfan 19 Mar 2007, 12:44 Ok, the first of all - i like it)
 then corrections & suggestions Code: 
format PE GUI DLL AT 500000h
    To avoid automatic reallocation of base. Code: bmpFileHeader BITMAPFILEHEADER 'BM',0,0,0,sizeof.BITMAPFILEHEADER + sizeof.BITMAPINFOHEADER It is more understandable Code: bmpFileName rb MAX_PATH MAX_PATH is defined in win headers (=260) Code: bmpInfo BITMAPINFOHEADER sizeof.BITMAPINFOHEADER,0,0,1,24,BI_RGB,0,0,0,0,0 rd 6 ;;WHAT IS IT FOR?WHY 6? Setting the bfSize in BITMAPFILEHEADER Code: mov eax,[scwHeight] imul eax,[scwWidth] imul eax,3 mov [bmpSize],eax lea edx,[eax+sizeof.BITMAPFILEHEADER+sizeof.BITMAPINFOHEADER] mov [bmpFileHeader.bfSize],edx its enough for a while;) _________________ Any offers? | |||
|  19 Mar 2007, 12:44 | 
 | 
| sleepsleep 19 Mar 2007, 16:15 thanks a lot    vid & asmfan  comments appreciated !!  | |||
|  19 Mar 2007, 16:15 | 
 | 
| vid 19 Mar 2007, 16:24 looking forward for newer version. This could make nice example if fixed | |||
|  19 Mar 2007, 16:24 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.