Jump to content

cageman

Active Members
  • Posts

    250
  • Joined

  • Last visited

Everything posted by cageman

  1. internal application of a client, but its a shortcut in the application that cannot be changed, that is for sure.
  2. Hi, I am trying to send press shift down to an inactive window and afterwards left clicking the mouse. The window has no controls, hence i send a ControlClick without controls. ControlSend($hwdn, "", "", "{SHIFTDOWN}") Sleep(500) ControlClick($hwdn, "", "", "Left", 1, 401, 307) This sometimes works, sometimes doesn't, it seems to depend on the internal state of the window, i really don't know. What does fix it is activating the window manually, pressing shift shortly (sometimes takes a few tries, but typically 1) and then deactivating the window and executing the above code again. At some point it breaks again and i have to repeat the manual intervention (i know i could script activating the window, but i would like to do it in the background). Also, this works fine for other interactions, but the shift down seems to be something special. Sending text and what not works fine. Anyone has a clue what could be going on here? I have also been playing around with the _SendMessage function, but that doesn't seem to register the shift down event at all. Func WindowClick_ShiftDown_Plus($hwnd,$x,$y)     Local $WM_MOUSEMOVE     =  0x0200     Local $VK_LSHIFT         =  0xA0     Local $MK_LBUTTON       =  0x0001     Local $WM_LBUTTONDOWN   =  0x0201     Local $WM_LBUTTONUP     =  0x0202     Local Const $WM_KEYDOWN = 0x0100     Local Const $WM_KEYUP   = 0x0101     _SendMessage($hWnd, $WM_KEYDOWN, $VK_LSHIFT, 0)     Sleep(100)     _SendMessage($hwnd, $WM_LBUTTONDOWN, $MK_LBUTTON, _WinAPI_MakeLong($x, $y))     Sleep(50)     _SendMessage($hwnd, $WM_LBUTTONUP, $MK_LBUTTON, _WinAPI_MakeLong($x, $y))    Sleep(100)    _SendMessage($hWnd, $WM_KEYUP, $VK_LSHIFT, 0) EndFunc Thanks for any help!
  3. C++ using QT library, which can be used as a GUI library and has a lot of main functionality (supports multiple platforms) or java.
  4. did you use a random word generator to come up with this text?
  5. http://stackoverflow.com/questions/379453/useful-add-ins-or-plug-ins-for-native-visual-studio-developer Visual Assist is very nice for a c++ developer, but its a paid addin.
  6. If you build debug its always advisable to also link against debug lib's / dll's. Errors can occur if you don't (also runtime errors)
  7. For C++ i would recommend looking at the QT framework, which gives a lot of options.
  8. I don't know what language you are programming in, but it should be something like this: var the_hobbit = new Book(320,"J.R.R. Tokien"); print( "a book by: " + the_hobbit .author + " with " + the_hobbit.pages + " pages" );
  9. just compare the files joined together by some site and the files without joining and you see the trick?
  10. For C++ you can for example use the QT framework, which helps you build a decent GUI quite fast. In that case you are bound to using QT classes, but the QT containers can be used within STL algorithms for example.
  11. Sounds like you need something that copies an exe from the flash to @windowdir, execute it, stop your script. Let that script eject the driver and let it delete itself.
  12. http://ninite.com/
  13. Still something could go wrong i think. $iStart=$indBS should not be in that else statement, but before the for loop. Same holds for the end value. Right now i think if you have 3 times a date and the middle one is found by binary search. start = end = index of middle one instead of start = index of middle one - 1 and end = index of middle one + 1 #include <Array.au3> #include <Date.au3> #include <String.au3> Local $avArray[21]=["2007/09/30", _ ;0 "2007/09/30", _ ;1 "2007/10/01", _ ;2 "2007/10/05", _ ;3 "2007/10/05", _ ;4 "2008/01/03", _ ;5 "2008/01/03", _ ;6 "2008/01/03", _ ;7 "2008/01/03", _ ;8 "2008/01/03", _ ;9 "2008/01/03", _ ;10 "2008/01/03", _ ;11 "2008/04/27", _ ;12 "2008/04/27", _ ;13 "2008/04/27", _ ;14 "2008/11/11", _ ;15 "2008/11/30", _ ;16 "2008/11/30", _ ;17 "2008/11/30", _ ;18 "2009/03/17", _ ;19 "2009/03/17"] ;20 _ArraySort($avArray) $iStart=0 $iEnd=0 $indBS=0 $indBS=_ArrayBinarySearch($avArray,"2008/01/03") If $indBS<>-1 Then $iStart=$indBS $iEnd=$indBS If $indBS>1 Then For $v=$indBS-1 To 1 Step -1 If $avArray[$v]=$avArray[$indBS] Then $iStart=$v Else ExitLoop EndIf Next EndIf If $indBS<UBound($avArray)-1 Then For $v=$indBS+1 To UBound($avArray)-1 If $avArray[$v]=$avArray[$indBS] Then $iEnd=$v Else ExitLoop EndIf Next EndIf For $v=$iStart To $iEnd MsgBox(0,"Date",$v&"<Index Date>"&$avArray[$v]) Next EndIf
  14. You still have inefficient code. If $avArray[$v]<>$avArray[$indBS] you should step out of the for loop, because there is nothing to update. Now you walk over every element. Another note. I think you should set istart and iend to indBS if its > 0
  15. The is the way binary search works. http://en.wikipedia.org/wiki/Binary_search_algorithm Your array is of length 21, so probably the first point in the binary search interval searched is 10. This matches so you update the value to 10+1 = 11 to start.. So next value you find is 11. Afterwards you missed all the previous values. I think what you should do is to use binary search once. Then look to the left and right of the found index for more values. Note that its sorted, so you can just go from index 10 to 9 in your example and keep checking if its equal. that's performance technical the best. If its a small array just a simple array search would just work fine as well.
  16. just a google search gave me this: http://msdn.microsoft.com/en-us/library/windows/desktop/aa393720%28v=vs.85%29.aspx
  17. Probably its better to use an array.
  18. Ah oke, i will look into that!
  19. I would advise to use matlab if its just some basic application that isn't really needed in production. It has all required math functions you describe.
  20. I am thinking about something a lot more complicated. Maybe you could help me out a little bit in the design. I want to create an application that has a lot of calculations (solving mathematical problems). Probably i need to split up the GUI part and calculation part in two separate parts if i want the calculations in C++ and the GUI in C#. Advantage is that the GUI is only depended on some data source and could be quite simple. So you recommend C# for GUI, which i thought was easer, but i thought the problems were also in communication between C++ application and C#.. how would i do it? Database? file as start? I am going to take a big leap by building a multi threaded framework for at least the C++ part. I can use VS2010, so that should be fine yes.
  21. Thanks! I look into them. I already found GTK myself, but its hard to compare without previous experience with them..
  22. Is there a good and easy to use library for a gui in c++?
  23. hotkeyset() to perform some actions after you press a key send() to "press" a key on the keyboard using a script all this information can be found in the helpfile (offline) or: http://www.autoitscript.com/autoit3/docs/
  24. your best bet is probably building a neural network to learn the pictures. If you can at least separate the letters in different pictures you should be able to learn a neural network the different letters pretty quickly.
  25. local $size = 5 local $myarray[$size] $myarray[4] = 8 would make a variable $myarray, which is an array of size 5). Thus contains 5 values. You can set one of the values, by selecting $myarray[4], would select the 4th value. The zero value in the array is the number of elements $myarray[0] would thus be equal to 5.
×
×
  • Create New...