Trainee Posted April 2, 2005 Share Posted April 2, 2005 This is my first post where I need some help. I am trying to use avicap32.dll in autoit, I have had success using it with assembly and a few other languages but Autoit seems to be a different animal. Any way I can return a handle of a capture window and it returns all expected values except $WS_CHILD or'ed to $WS_VISIBLE resolves to 1. $hVidCap = dllcall("avicap32.dll","int","capCreateCaptureWindowA","str","test","int",$WS_CHILD or $WS_VISIBLE,"int",0,"int",0,"int",100,"int",100,"hwnd",$MainhWnd,"int",0) Of course this crashes the script. I've tryed to solve this myself but I maybe misunderstanding how autoit sees messages in the dllcall. Thanks Outcastprogramming Link to comment Share on other sites More sharing options...
Trainee Posted April 2, 2005 Author Share Posted April 2, 2005 Thanks larry for responding so quick, I did try the BitOr previously and it still crashed my script. Here's what I have so far, keep in mind it maybe a little messy. #include <GUIConstants.au3> #include <VidCap.au3> #NoTrayIcon DIM $hVidCap $MainhWnd = GUICreate("",250,250) GUISetState(@SW_SHOW) $hVidCap = dllcall("avicap32.dll","hwnd","capCreateCaptureWindow","str","test","int",BitOR($WS_CHILD,$WS_VISIBLE),"int",0,"int",0,"int",100,"int",100,"hwnd",$MainhWnd,"int",0) GUICtrlCreateLabel($hVidCap[0],10,40,350) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect Wend I'm still getting a crash, note that when or if I get this working I do intend to offer the VidCap.au3 include file. For this part of the script it's not needed. The previous method I used did return a handle. I had considered writing a dll for this but...hey where's the fun in that? Api: HWND VFWAPI capCreateCaptureWindow( LPCSTR lpszWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWnd, int nID ); Outcastprogramming Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now