|
Hi, me again!?
Sorry to be such a pain in the a$$, but was wondering if anyone knows if it is possible to control a powerpoint presentation with a c++ program?
I have been building a remote control application for the computer (eventually, I want to add a USB-serial adapter, so that I can connect a remote receiver to USB...). So far, I can control Winamp, iTunes, WMP and BSPlayer (the only programs I really use for multimedia) and when theyre not running, it will control windows volume. It also has an overriding mute, that will always mute everything.
I was thinking the next/prev track buttons could be used to control a powerpoint presentation, as this could be useful for the future... but its proving difficult to find any information on it...
Does anyone have any ideas?
Thanks,
Mark
|
|
|
|
|
Try this[^]. PowerPoint's fairly easy to control - I've done it a lot.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
wow! thats great! ive looked everywhere... dont know y i couldnt find anything...
but thanks a lot! looks like its gonna take me a while to get my head round, but at least it must be doable! is always nice to know...!!
do you know if this would also control the presentation if being viewed through powerpoint viewer/standalone presentation? im guessing not...
Also, it doesnt mention controlling slides when the slideshow is running... is that similar?
Thanks a lot,
Mark
|
|
|
|
|
markhaslehurst wrote: do you know if this would also control the presentation if being viewed through powerpoint viewer/standalone presentation?
PowerPoint has to be installed for it to work. Your application will start PowerPoint and work from there.
markhaslehurst wrote: Also, it doesnt mention controlling slides when the slideshow is running... is that similar?
You can use the Next() and Previous() methods on the SlideShowView class for that.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
great! that gives me a lot to work with!
Thanks for the help!
Mark
oh, btw... one question... I dont have Visual C++, i use a free command line Borland compiler... so do you know how I can use the MSPPT.OLB file?
Thanks!
|
|
|
|
|
markhaslehurst wrote: I dont have Visual C++, i use a free command line Borland compiler... so do you know how I can use the MSPPT.OLB file?
Oh, just a minor detail
I've never used Borland, so I don't know how it does things. You can download the free Visual C++ Express Edition from here[^]
BTW, the file is just a renamed type library. You can rename it to .tlb if Borland handles them...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
lol.
no.. renaming doesnt work... but i have downloaded the visual c++ installer... it wants to download a lot more though... so i think ill run it tonite, or else the rest of the company wont be able to get on the net!
thanks a lot for all the help mate.
Mark
|
|
|
|
|
markhaslehurst wrote: no.. renaming doesnt work...
Bummer. I could send you the source files that are generated when the Visual C++ compiler imports it, but they are MFC specific, so won't work with Borland or the Visual C++ Express Edition.
I hope the express edition supports .olb files, or you might have a small problem
Anyhow, glad I could help Have fun!
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
na. s'ok. thanks a lot for all help mate.
ill just have to give it a go and see...!
Thanks a lot, its really appreciated.
Mark
|
|
|
|
|
markhaslehurst wrote: I dont have Visual C++, i use a free command line Borland compiler
have you noticed on what forum/site you asked ??
Codeproject is quite dedicated to Microsoft technologies...
|
|
|
|
|
sorry... didnt realise... and to be honest, most sites are geared at MS products... just also seems like the best c++ forum around... and for most things, the compiler is not important.
|
|
|
|
|
markhaslehurst wrote: for most things, the compiler is not important.
hum, if you mean "most" for "standard C++", yeah, if is stands in the standard implementation of the compiler (knowing that nowadays, no compiler implements 100% of the C++ Standard, not even VC++2005).
but if you ask for an OWL question, i think that most people here won't know about it at all...
|
|
|
|
|
well i dunno what OWL is. im only a beginner, but all the advice i have received and all the articles that i have read on this site have worked using my compiler until this library problem, so dont think it really matters for the majority of coding.
|
|
|
|
|
OWL is the graphical library of borland (equivalent of MFC in Visual C++).
actually, if you work in console, yes, using cout/cin (or worse, C function like printf(), etc...) will work because there are part of the standard. standard mean that all C++ compiler provides them, and they work the same way.
if you need to use a specific library (gotoxy() for instance), it won't work on microsoft compiler.
|
|
|
|
|
oh right. well wasnt asking questions about it... jus said do you know if theres another way to convert the file...
but up until now, ive been doing fairly simple things like program control and serial port interface, so havent needed anything special like that... just standard header files.
im not using console cout/cin type applications... im generating proper win32 windows and that... in the same ways that all the articles on the net do... but i guess most of the common stuff is the same no matter what you use...
|
|
|
|
|
Sir
I want to know the when to Add a Virtual Funtion and Message Handler for a class in classview pane of editor.
generally we do it by right clicking on a particular class
we get a pop menu.please help me in knowing it better.
in what generic case we go for a virtual Function.
and what other case we opt for Message Handler.
thank u.
|
|
|
|
|
a virtual function is a functionnality of the C++ language.
events handlers are really dependant of the system they're targetted for...
|
|
|
|
|
Hi,
What is the difference between a process handle and a window handle? Is there any convertions between the two?
Thanks
|
|
|
|
|
A window handle (a HWND ) identifies a window and a process handle (HANDLE ) enables you to monitor/control a process. There is no direct meaningful conversion between them. That said writing code what enumerates all the windows handles in a given process is possible. It is also possible to go from a HWND to a HANDLE for the owning process as follows:
DWORD dwProcessID;
GetWindowThreadProcessId(hWnd, &dwProcessID);
HANDLE hProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessID);
Steve
|
|
|
|
|
HWND is a Handle to a Window
Where as process handle is a handle to a process (Note: a process may or maynot have a window)
So Both are different things, the correct question will be
how can i get the process id if i have the HWND of one of its windows
GetWindowThreadProcessId gives the process id
to get the opposite (processid to window handle) you have to enumerate all the windows and compare the process id.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Yeah. I do accept that a window handle is a handle to a window and a process handle is a handle to a process and not all the time a process can have a window. But, Internet Explorer has a window by default. If I am gonna launch IE from my application as a process I get the process handle for IE. At this point of time, will I be able to get the window handle of the new IE process launched or is there any methods that converts my process ID got(from createprocess functions) to a window handle.
|
|
|
|
|
any methods that converts my process ID got(from createprocess functions) to a window handle.
First of all don't use *convert*, second open Spy++ and open up IE then you will see that IE has lots windows, not just one window (toolbars,menus ...) so the question is which window's handle you want
what do you want to do anyway ?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
As Monty v2.0 said, a mapping from a process to a HWND is a one to many mapping. Here's how you would go about doing it however:
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
DWORD dwProcessID;
GetWindowThreadProcessId(hwnd, &dwProcessID)
if ( dwProcessID == lParam )
{
{
return TRUE;
}
CloseHandle(pi.hThread);
WaitForInputIdle(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
EnumWindows(&EnumWindowsProc, pi.dwProcessId);
I have not actually tested this code but the idea is sound.
Now that I've given this example here's some advice - DON'T USE IT (unless you have no choice)! You should look into controlling IE through OLE Automation.
Steve
|
|
|
|
|
Hi All,
I have my own application(EXE). My application has the ability to launch another process like calculator etc etc. Now, I create a new toolbar button and on click of that I launch Internet Explorer. It launches fine. Now my doubt is whether I can have the entire control of this new process(Internet Explorer) launched? Meaning that can I control the Internet Explorer the way I want.
Its a bit urgent. Please can anyone respond me at the earliest?
Thanks
|
|
|
|
|
There are many ways to control IE one them is BHO. Here[^] is a perfect example.
You can also Host an IE instance in you Dialog (using activex IE control)
There is also DDE[^] approach.
you have to decide what suits your need
Hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|