Jump to content

HeartsOfWar

Member
  • Posts

    49
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About HeartsOfWar

HeartsOfWar's Achievements

0

Reputation

  1. From all the documentation I can find, you are doing everything right... Here is what I've found.... VOID CALLBACK InstallHinfSection( HWND hwnd, HINSTANCE ModuleHandle, PCTSTR CmdLineBuffer, INT nCmdShow ); Declare function InstallHinfSection Lib "setupapi" Alias "InstallHinfSection" (ByVal hwnd As String, ByVal ModuleHandle As String, ByVal CmdLineBuffer As String, ByVal nCmdShow As Integer) as long The only thing I see different from yours is you declared yours as an Auto Sub, and you didn't include a 'As long' at the end. I'm not sure if this helps or makes a difference, but I have also discovered that Visual Basic can use a BSTR in the place of a LPCSTR, so ByVal CmdLineBuffer As String is correct... definately.. no conversion needed
  2. Not a good idea if you use OUTLOOK... OUTLOOK needs Outlook Express
  3. Outlook previous to 2003 - do a search for a (or multiple) *.pst files... these are the files that Outlook stores mail and such inside... Outlook 2003 - do a search for *.pst AND *.ost files... the *.ost is the new format, but it is backwards compatible, so you should search for both... Generally found in (C:\Documents and Settings\<user name>\Local Settings\Application Data\Microsoft\Outlook) Address book - *.wab AND *.pab files... these are the files that your address entries are stored... Generally found in (C:\Documents and Settings\<user name>\Local Settings\Application Data\Microsoft\Address Book)
  4. I'm not a die-hard fan of any broswer, but Firefox is definately the best choice out there... Firefox is not Netscape... Yes, there are similarities, but Netscape is definately in a league of it's own (Bloat league)... Also, one of the powerful features of firefox is the extensions... you simply cannot beat tab browsing, ad block, and mouse gestures... It took me about a week to get used to firefox... try it at least this long... but if it isn't for you... well it just isn't for you.
  5. The documentation of the function you're wanting to call is written specifically for a C / C++ environment. However, you can achieve what you need done by making a call to the console using this syntax RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection <section> <mode> <path> Replace <section> with the type of installation Replace <mode> with 128 or 132 replace <path> with the absolute path to the *.inf file This will kick-off the installation using the *.inf file as the driver... for more information see here - http://msdn.microsoft.com/library/default....hinfsection.asp OR you could just call the setupapi.dll and use the internal library, pass the values, and go from there.
  6. When selecting the project type, refrain from selecting anything that has .NET on the end...
  7. Yeah, I was going to tell you to use Mouse_event, but I decided against it because it isn't the most up-to-date... I guess it would have been easier... hehehe - glad it works
  8. Use SetFocus function see here - http://msdn.microsoft.com/library/default....ns/setfocus.asp
  9. I have edited your code... #define _WIN32_WINNT 0x0501 #define WINVER 0x0501 #include <windows.h> #include <iostream.h> #include <WinUser.h> int a,b; int xstart=-10; int ystart=-20; char dd; char * pch; HWND hwnd; char texttitle[255]={0}; char word[255]; BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) { GetWindowText(hWnd, texttitle ,sizeof(texttitle)); if(texttitle[0] != 0){ pch=strstr (texttitle,word); if (pch!=NULL){ hwnd=hWnd;}} return TRUE; } int main(){ INPUT *InpPtr = new INPUT; InpPtr->type = INPUT_MOUSE; InpPtr->mi.dx = 380; InpPtr->mi.dy = 457; InpPtr->mi.mouseData = XBUTTON1; InpPtr->mi.dwFlags = MOUSEEVENTF_LEFTDOWN; InpPtr->mi.time = 0; InpPtr->mi.dwExtraInfo = 0; INPUT *InpPtr2 = new INPUT; InpPtr2->type = INPUT_MOUSE; InpPtr2->mi.dx = 380; InpPtr2->mi.dy = 457; InpPtr2->mi.mouseData = XBUTTON2; InpPtr2->mi.dwFlags = MOUSEEVENTF_LEFTUP; InpPtr2->mi.time = 0; InpPtr2->mi.dwExtraInfo = 0; cout<<"Input a word from window title \n"; cin.getline(word,255); EnumWindows(EnumWindowsProc,0); SetWindowPos( hwnd, HWND_TOP, xstart, ystart, 2, 2, SWP_NOSIZE ); cout<<"Hit enter to automatically use mouse "; cin.get(); cin.get(); SendInput(1,InpPtr,sizeof(INPUT)); SendInput(1,InpPtr2,sizeof(INPUT)); delete InpPtr; return 0; } Copy and paste what I have... should work fine... You need to put the #defines at the very top, before the #includes... Also, I don't see why you need stdafx or the other header file, so I removed them. I also put your INPUT variable declarations within MAIN... GLOBAL variables are very almost as bad as GOTO statements... you should try and keep them to a minimal if none at all.
  10. Add this to the top #define _WIN32_WINNT 0x0501 #define WINVER 0x0501 Remove what you said you needed... before Also, change the code accordingly, INPUT *InpPtr = new INPUT; InpPtr->type = INPUT_MOUSE; InpPtr->mi.dx = 380; InpPtr->mi.dy = 457; InpPtr->mi.mouseData = XBUTTON1; InpPtr->mi.dwFlags = MOUSEEVENTF_LEFTDOWN; InpPtr->mi.time = 0; InpPtr->mi.dwExtraInfo = 0; Before you exit, make sure to delete *InpPtr delete InpPtr; This should work...
  11. SendInput is the latest function that Win32 API uses... SendInput integrates the ability of sending a command to the keybord, mouse, or other hardware that can support inputs. Since SendInput is so versatile, you must first set-up some initial data... first create a data structure known as INPUT INPUT test; You want to initiate a mouse event, so we need to focus on an INPUT structure that is suited for a mouse. This leads us to INPUT_MOUSE. See this document for more information or further explanation of the MOUSE_INPUT structure. Load the structure accordingly... test.type = INPUT_MOUSE; test.mi.dx = 25; test.mi.dy = 25; test.mi.mouseData = XBUTTON1; test.mi.dwflags = MOUSEEVENTF_LEFTDOWN; test.mi.time = 0; test.mi.dwExtraInfo = 0; Now create a pointer of type INPUT to the above variable... INPUT *InpPtr = test; Once that is done, now call SendInput passing the parameters... SendInput(1,InpPtr,sizeof(INPUT)); The program should send a left mouse DOWN message to x coordinate 25 and y coordinate 25. I think you will also need to simulate a left mouse UP message to the same coordinates in order to qualify as a full click.
  12. Use the GetCursorPos function, documentation found here, to retrieve the mouse position. Use the SetCursorPos function, documentation found here, to reposition the mouse. Use the SendInput function, documentation found here. You will need to reference MOUSEINPUTS, documentation found here, to simulate LEFTDOWN, LEFTUP, etc... events. ----------------------------------------------------------------------------------------------- Keep in mind that the window may appear at the same X, Y coordinates on your machine, but other people use different resolutions and a different resolution will change the X, Y coordinates. Since you have the handle to the window or can easily retrieve the handle, you may want to retrieve the X, Y coordinates before simulating the mouse to be safe.
  13. Maybe, in english, type the problem that was given to you... This way we can read the description and work it on our own...
  14. Rightly so, C++ is not the best language suited for all jobs, but you can't argue that is is the pinnacle and one of the hardest to master and one of the widest used for almost everything computers. I wasn't trying to offend anyone, and that was certainly evident by my last question... I point-blank asked him what he didn't like. I was Giving him a chance to defend his position... However, those individuals that say they have no respect for C++ or don't find it powerful, usually don't know how to use it... this is very common within in beginners... I don't know about you, but there have been very few programs where my employers requested a different language than C++, knowing this, an individual that can't get along with it... is like a girl in the boys bathroom...
×
×
  • Create New...