Jump to content

OldCoder

Active Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by OldCoder

  1. Hey, no problemo. I appreciate it mucho. I did like the idea, (http://www.autoitscript.com/forum/index.ph...st&p=428355), and tried to work with it early in this project, but I could not get just the SysListView321 pane or a detailed view from it. It's probably some defect in my programming ability, maybe I should learn C++. Couldn't hurt, right? Again, thanks for your help. I will keep forging on, hopefully someone knows the answer to this puzzle. Cheers, friend.
  2. Hey, thanks for the reply, Smoke. Yeah, I've seen this, even mentioned it in my query. It's really nice, but not really what I'm looking for. In my original query I stated what I was trying to do was call a dll or object maybe that could simply show like one of Windows Explorer's SysListView321 panes in detailed view in my application. Have been looking through Microsoft's stuff and C++ but haven't found anything yet, not that I could probably make head nor tails of that stuff anyway. Any help you guys? Thanks. Cheers
  3. What I'd like to do is create a listview with folders and files of directories, (kind of "FileOpenDialog" meets "FileSelectFolder"), inside a pane in my application and be able to get selected or drag/drop info, etc. I've been using listview to try to simulate the Windows Explorer, but it's too slow for really large directories and, while the icon representations, using cross references to the registry, are good, they aren't 100% accurate. To me, it seems I am trying to re-invent the wheel. There must be some DLL call or something I can do to create an actual boxed, detail view of Windows Explorer in my app. I've searched fairly extensively through the forum and found some cool stuff, some simulate Explorer, some actually embed applications inside your program...nice. However, none of these seems as elegant or as useful as actually being able to call a DLL or create an Object that was the real deal. Is there anyone who knows anything about this? Any help you can offer would be appreciated. Thanks. Cheers
  4. Yeah. I appreciate the help. I've decided that the problem is above my pay-grade and must admit to defeat. On the other hand, simulating a tray menu is far more feasible and offers a great deal more options and flexibility. This is the way I am going with this now, though it has been a tad problematic, I am sure I'll be able to work out the bugs. Thanks again & cheers.
  5. LMAO... sounds like something I would do. Went and took that color quiz thingy. First time I took it, being a bit self righteous in my answers, but basically turthful, I was blue, the enmy of red. Then I took it again, most of the answers were the same, but I was much more truthful and it came out red. LOL. Goes to show you....you can never let anyone tell you who you are... they don't even know who they are.
  6. LOL... I do that WAY too often. It goes along with my patience issues. Someone just take my mouse away from me.
  7. Without the code it makes it a little hard to guess at your problem, but I've seen that -1 line number before and I think it was when I used an external routine. Are you including Array.au3? Perhaps your problem is in the syntax in the command sent to Array.au3. Hope this is helpful. Cheers.
  8. Thanks Swift, and you are right, I need to have some patience. I was a tad frustrated last year when I had no replies at all to my "TV CARD CONTROL" question and I guess it WAS a hard question. Thanks again. Cheers
  9. Yes, that is correct. Not just the tray tool tips, but the tray item itself is not showing the update. I am lost.
  10. Hey Bert; Thanks for your speedy reply. It would be my first. LOL. As far as research goes and searching this forum first, I do that. I really don't want to waste anyones time by asking questions that have already been answered. I see forums such as these as a "last resort", since there are probably people out there who could use your help more then me. In my "TV CARD CONTROLS" question I used script examples and definitely had done a buttload of research. In my last topic from today, "DYNAMIC TRAY MENU REFRESH", I think I did plenty of research and posed my questions fairly clearly. I know the questions are probably fairly hard, or why else would I be asking. LOL. Well, I'll just keep hacking away and see what may come. Thanks again.
  11. Hey, I've posted in this forum before and am wondering if maybe I am doing something wrong or my settings are wrong or something. As with my previous posts, I have received no replies. I see other posts receive replies within seconds. Are my settings wrong or are my questions unclear? The two questions I have posted are from today under General Help and Support, "Dynamic Tray Menu Refresh", and from November of last year, also in General Help and Support, "TV Card Controls". What gives? This is the first forum that I have ever belonged to and it is definitely within the realm of possibilities that I have no idea what I am doing. So, maybe someone can buy me a vowel and give me a clue. Thanks.
  12. Hi, I have searched the forum far and wide, (well, more far then wide), and have come up with nada. I am wondering if there is a way to dynamically update an item in the tray menu while it is being viewed so as to show the new update. Basically I have a count-down timer inside my tray menu and would like to see changes in that timer as they occur. I do update the item with TrayItemSetText, but it won't show these changes unless I repeatedly click the icon. Also, in a related issue, is it possible to update the tray tool tip in the same manner, (ie. while the mouse is over the tray icon, the timer in the tray tool tip updates as you view it)? Thanks in advance for any help anyone can give. I have noticed similar things within AutoIt and have wondered if I am just missing something. Thanks.
  13. Yeah, I searched the web, found alot of info out there, and have saved it and tried working with it. But, all of it is written in either C++ or VB and I just can't seem to translate from either to AutoIt. I suppose I could try to learn C++ or VB/VB.NET, but the ease of AutoIt is why I chose it in the first place. My biggest problem is getting DLLCalls to work. Some of the code is so complicated, (for my little brain), that I just can't seem to make it work in AutoIt.
  14. What you may want to try is taking out your Sleep commands and replacing the first one with the GUIGetMsg() function. This gives other applications a chance to use processing time. (Check out the REMARKS section of this command). While 1 _check() GUIGetMsg() WEnd Func _check() If WinActive("Navision XAL", "Udskriftsmuligheder") then $Count = $Count + 1 ;GUICtrlSetData($counter, $Count) WinWaitNotActive("Navision XAL", "Udskriftsmuligheder") EndIf If $count = 37 Then MsgBox(16, "Warning", "Om ca. 2 følgeseddler kommer følgeseddels fejlen") ; $Count = 0 EndIf EndFunc Hope this is helpful. Cheers!
  15. OK, a final note. If you wanted to save the data in a new file, here's the same script with a save feature. I wasn't sure of your scripting abilities at this point and thought I might want to update my earlier script. Here it is: $csv=FileRead("data.csv") ; Where "data.csv"is your DATA file $a=StringSplit($csv, @CRLF, 1) $NumOfEntries=$a[0] + 1 Dim $b[$NumOfEntries] $newdata=FileOpen("newdata.csv", 2) ; Where "newdata.csv"is the file name for your NEW DATA file For $t = 1 to $NumOfEntries - 1 If $a[$t]<>"" Then FileWriteLine($newdata,StringMid($a[$t],1,StringInStr($a[$t],"|")-1)) endif Next FileClose($newdata) Again, I've tested this and it does seem to work fine.
  16. BTW, if you are not getting the results you want, the line feeds may be just a carriage return or just a line feed. Try replacing line two of my script with one of the following: $a=StringSplit($csv, @CR) ; for single carriage return $a=StringSplit($csv, @LF) ; for single line feed Good luck.
  17. As the two replies before me pointed out, StringInStr and StringSplit are good tools for what you want. I would implement it like this, (if the information is within a file and is formated like the shown example, line feed at end of the line): $csv=FileRead("data.csv") ; Where "data.csv"is your DATA file $a=StringSplit($csv, @CRLF, 1) $NumOfEntries=$a[0] + 1 Dim $b[$NumOfEntries] For $t = 1 to $NumOfEntries - 1 If $a[$t]<>"" Then $b[$t]=StringMid($a[$t],1,StringInStr($a[$t],"|")-1) MsgBox(0,"",$b[$t]) ; Just for viewing the results endif Next I've tested this with your information & it seems to work fine. Hope this is helpful. Cheers!
  18. <REPOST> (Forgot to make my email available...oops) I found the following script under the Example Scripts forum and left my query there. But it's been awhile since ppl have posted there, so I thought maybe the thread was dead and that I should post here. WEBCAM\CAPTURE EXAMPLE: $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START +100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") $snapfile = @ScriptDir & "\scrshot.bmp" $moviefile = @ScriptDir & "\moviecam.avi" $Main = GUICreate("WebCam - Ready",350,300) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 320, "int", 240, "hwnd", $Main, "int", 1) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) ;DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 30, "int", 0) $Combo = GUICtrlCreateCombo("Video Source",15,270,140,-1,$CBS_DROPDOWNLIST) GUICtrlSetData(-1,"Video Display|Video Format|Compression","Video Source") $Button = GUICtrlCreateButton("Show",170,270,100,21) GUICtrlSetOnEvent(-1,"Button") GUISetState(@SW_SHOW) HotKeySet("{INSERT}", "SnapShot"); Press 'Insert' to make a SnapShot ! HotKeySet("{HOME}", "StartRecording"); Press 'Home' to start recording ! Func Quit() ;DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_CALLBACK_FRAME, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) ;DllClose($avi); crashing, no one knows why... DllClose($user) Exit EndFunc Func Button() Switch GUICtrlRead($Combo) Case "Video Source" DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOSOURCE, "int", 0, "int", 0) Case "Video Display" DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEODISPLAY, "int", 0, "int", 0) Case "Video Format" DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOFORMAT, "int", 0, "int", 0) Case "Compression" DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOCOMPRESSION, "int", 0, "int", 0) EndSwitch EndFunc While 1 Sleep(1) Wend Func SnapShot() DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $snapfile) EndFunc Func StartRecording() WinSetTitle($Main, "", "WebCam - Capturing...") HotKeySet("{HOME}", "StopRecording") DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SET_CAPTURE_FILEA, "int", 0, "str", $moviefile) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SEQUENCE, "int", 0, "int", 0) EndFunc Func StopRecording() DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_STOP, "int", 0, "int", 0) WinSetTitle($Main, "", "WebCam - Ready") HotKeySet("{HOME}", "StartRecording") DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $moviefile) EndFunc MY QUERY IN THE EXAMPLE SCRIPTS FORUM: To clarify, I know that you can bring up a dialog and set these things manually, however I'd like to do it from the script. I hope someone can help me out. Thanks.
  19. I found the following script under the Example Scripts forum and left my query there. But it's been awhile since ppl have posted there, so I thought maybe the thread was dead and that I should post here. WEBCAM\CAPTURE EXAMPLE: CODE $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START +100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") $snapfile = @ScriptDir & "\scrshot.bmp" $moviefile = @ScriptDir & "\moviecam.avi" $Main = GUICreate("WebCam - Ready",350,300) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 320, "int", 240, "hwnd", $Main, "int", 1) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) ;DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 30, "int", 0) $Combo = GUICtrlCreateCombo("Video Source",15,270,140,-1,$CBS_DROPDOWNLIST) GUICtrlSetData(-1,"Video Display|Video Format|Compression","Video Source") $Button = GUICtrlCreateButton("Show",170,270,100,21) GUICtrlSetOnEvent(-1,"Button") GUISetState(@SW_SHOW) HotKeySet("{INSERT}", "SnapShot"); Press 'Insert' to make a SnapShot ! HotKeySet("{HOME}", "StartRecording"); Press 'Home' to start recording ! Func Quit() ;DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_CALLBACK_FRAME, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) ;DllClose($avi); crashing, no one knows why... DllClose($user) Exit EndFunc Func Button() Switch GUICtrlRead($Combo) Case "Video Source" DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOSOURCE, "int", 0, "int", 0) Case "Video Display" DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEODISPLAY, "int", 0, "int", 0) Case "Video Format" DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOFORMAT, "int", 0, "int", 0) Case "Compression" DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOCOMPRESSION, "int", 0, "int", 0) EndSwitch EndFunc While 1 Sleep(1) Wend Func SnapShot() DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $snapfile) EndFunc Func StartRecording() WinSetTitle($Main, "", "WebCam - Capturing...") HotKeySet("{HOME}", "StopRecording") DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SET_CAPTURE_FILEA, "int", 0, "str", $moviefile) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SEQUENCE, "int", 0, "int", 0) EndFunc Func StopRecording() DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_STOP, "int", 0, "int", 0) WinSetTitle($Main, "", "WebCam - Ready") HotKeySet("{HOME}", "StartRecording") DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $moviefile) EndFunc MY QUERY IN THE EXAMPLE SCRIPTS FORUM: To clarify, I know that you can bring up a dialog and set these things manually, however I'd like to do it from the script. I hope someone can help me out. Thanks.
  20. Had an error, this is why this appears twice. Sorry.
  21. Hi, I'm new, so be gentle. I have been coming to this forum and using AutoIt for some time now and must say that I am quite impressed with both. Now, with the back-slapping out of the way, I'd like to ask a question. The WebCam script posted here is really quite good and has opened some avenues for me. However, I am not a C++ programmer and am a bit lost in the whole workings of it. I am using a TV card instead of a cam with this script and I'd like to take the script and be able to change the actual resolution of the output, (to say 640 x 480 or 1024 x 768). Not change the scale, (which one could do on this line: $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 320, "int", 240, "hwnd", $Main, "int", 1) ) but the actual resolution. Also, I'd like to be able to get/set the channel and get/set capture device info. Any help anyone could give me would be greatly appreciated. I'd also like to point out that the recording side of this script didn't work with my TV card. I fixed this by changing the last line of the StopRecording() function from: DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $moviefile) to: DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEASA, "int", 0, "str", $moviefile) if this is at all helpful to anyone. Thanks in advance. (Should this have been posted in the General Support part of this forum or under this thread)? Hope to hear from anyone soon.
×
×
  • Create New...