I think a lot of what you asked about can be done with the Win32 API. You might browse through the MSDN library to see which functions seem appropriate.
This thread contains a brief API tutorial:
In my answers, I'm going to be a bit vague, partly because I completely lack experience with many of the things you asked about. Partly because there are too many questions for me to focus on any one in detail at the moment.
-How do you make it seem like the keyboard is being pressed for things outside the program, like ctrl-c or alt-f4?
>I want to be able to activate it from a program but _SCREENPRINT (CHR$(0) + CHR$(130)) and _SCREENPRINT (CHR$(0) + CHR$(131)) doesn't register with it. It works fine when I actually type it or when i change it to something simpler like "a". Any ideas?
There might be some other way, besides trying to simulate a keystroke. There might be some message that you can send to the program to tell it to activate.
-How do you obtain a list of programs names that have windows open?
EnumWindows, GetWindowModuleFileName, and GetWindowText look potentially helpful. However, anything that involves needing a callback function will require some C++ code.
-How do you obtain a list of all the programs installed on the system?
I would think the information is in the registry. Where in the registry would be the proper place to look, I don't know. Here is an example of accessing the registry:
-How do you get the variable of the name of the program of the window you are currently on?
Do you mean your own program, or the foreground window?
Do you mean the title or the executable file name?
For your own program:
The title would be tricky, because I think you would need an HWND first, but the usual way in QB64 of getting your own HWND involves setting your title. :-P
If you mean the file name: GetModuleFilename. There should already be examples in the wiki and on the qb64 forums.
To find the active window: GetForegroundWindow, then probably either GetWindowModuleFileName and/or GetWindowText. Here is an example of GetForegroundWindow to find if your program has focus:
-How do you switch between windows? Like switch to any of the windows, not just Alt-Tab. I guess changing the variable from the question above this one.
Check out SetForegroundWindow.
-How do you get the address ('C:\Documents and Settings\etc') of the thing or things you have highlighted in a Windows Explorer window?
If there is such a thing, I would suspect that it's in the Shell API.
>What about when you drag something from a folder into a program and it recognizes it and does things, iTunes for example, it would need to know what and where you are dragging it from.
That might be either the Shell API or something to do with Window Messages... :-P
I take it you mean while your program is already open. Otherwise, it's a command line parameter.
Return to Index
|Response Title||Author and Date|
|Re(2): Thanks for the response||Zack on Mar 25|
|Re: Re(2): Thanks for the response||Michael Calkins on Mar 25|
|Re(4): Thanks for the response||Zack on Mar 25|