Jump to content

HeartsOfWar

Member
  • Posts

    49
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by HeartsOfWar

  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...
  15. If you don't find C++ very satisfying, then your calling as a programmer should be seriously considered... I know not everything is done in C++, and quite frankly, if you limited yourself to just C++ you'd be screwing yourself, but C++ is the pinnacle and has been for some time... What don't you like about it???
  16. I won't participate in the poll... simply because it's irrelevant what someone else thinks. You are the best judge on which language suits your needs at this point in your education. If you want to continue using a RAD (Rapid Application Development) IDE but increased power, C# is the way to go. If you want to branch out, leaving the GUI by the wayside (Concentrate on algorithm development and XP programming) for the time being, then C++ is the way to go. It all depends on what you feel you can handle...
  17. You could use Visual Studio to do any of those languages... The .net platform is not built into the program unless you specifically include it... C++ would be the more obvious choice for stability, but it will make the project considerably harder...
  18. Not to be rude or overly critical... but... I don't see this being anything special... I think you'd be wasting your time... Of course, if you were doing it for the learning experience, I see nothing wrong with it, but if you're doing it to release to the public in hopes someone likes it... Don't hold your breath. I mean think about all the programs that do what yours does already... I just don't see the need to reinvent the wheel... but that's up to you. Also, most languages are not permutations of each other... Most languages differ considerably from each other... even Java and C++, which look very simillar, are VERY different.
  19. If you've used Visual Basic, then you may want to learn C#... C#, like visual Basic, is very managed and easy to develop programs with GUI interfaces; however, C# is much more robust than Visual Basic and almost as powerful as C++...
  20. *.vbs is visual Basic script... Commonly used to write a windows Script.... Just google Windows Scripting.... I found this ----> VBScripting
  21. Great... Glad to know I could help... I know how you feel... that's why I'm A CSC major ;-)
  22. It's a child window? And you didn't create the Window... you're just trying to manipulate it? You need to use 'FindWindow' along with 'FindWindowEx'... Use 'FindWindow' to retrieve the HWND of the TOP WINDOW or PARENT window. You will need to know the className or WindowName. The preferred method is the className, as it is unique..., but if you didn't make the window, you won't know that. SO use the PARENT Window Name instead. Once you have the PARENT HWND, use that variable within 'FindWindowEx' to locate the child Window. Once again, you're going to need either the Child's Class name or Window name. Same rules apply as the PARENT. Then try setting the Window Position using 'SetWindowPos'. HWND Phwnd, chwnd; Phwnd = FindWindow(NULL,"CLASSNAME", "WINDOWNAME"); chwnd = FindWindowEx(Phwnd, NULL, "CLASSNAME", "WINDOWNAME"); SetWindowPos(chwnd, HWND_TOP, 100, 100, 2, 2, SWP_NOSIZE);
  23. If you didn't keep track of the HWND variable when you created the window, using CreateWindow or CreateWindowEx, then yes you can use FindWindow, but that is a mediocre way of doing it. Better to track the variable like so: hwnd = CreateWindowEx(NULL, ClsName, WndName, WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, WndWid, WndHgt, NULL, NULL, Instance, (void*) this) This way, you always have the TOP window handle in case you need it... If you did it this way, use the variable you used instead. You're not using the function properly... First, the 'BOOL' word lets you know that the 'SetWindowPos' function will return a true or false when it has actually been called. You don't need to write this when calling it. Second, When you call a function, you don't include the DATA TYPE declaration... so, you can remove the HWND in front of the first & second parameters, along with removing the 'UINT' from the final parameter. Your final result should resemble something of this nature: SetWindowPos(hwnd, HWND_TOP, 100, 100, 2, 2, SWP_NOSIZE); However, you may want to review those numbers, because your function will create the window offset by 100 vertically & Horizontally, but it would only have a width & height of 2 pixels.... Is that what you wanted?
  24. Use windowPOS see the documentation here http://msdn.microsoft.com/library/default....s/windowpos.asp
×
×
  • Create New...