|
Superman,
Do you have any sample code that explains how to do this?
Thanks
|
|
|
|
|
Does Google not work in your neighborhood? He gave you the functions/messages to use, so how hard can it be to find samples of them?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Superman,
I am using an Edit Control.
I tried using the WM_CTLCOLORSTATIC message and added the,
SetBkCOlor and SetTextColor function.
But this is not working
Is it due to the fact that am using Edit Control?
I also tried using SelectObject and passed a BLACK brush, but that also doesn't seem to work
As soon as the Edit Control is disabled, the text in Edit Control becomes grayish.
|
|
|
|
|
You have to use SelectObject and pass in a BLACK pen, not a brush.
|
|
|
|
|
Inside WM_CTLCOLORSTATIC, i check whether lParam is equal to Edit Control handle, if thats TRUE
then i CreatePen by passing RGB(0, 0, 0), the resultant PEN is
then passed to SelectObject(HDC, PEN);
But this is not working. Any idea why it's not?
Do i need to "return" something for the WM_CTLCOLORSTATIC ?
Like, GetStockObject or something?
|
|
|
|
|
If your pen that you created is going out of scope when WM_CTLCOLORSTATIC returns then it will be destroyed and the control will be greyed. Watch your object lifetimes.
If this does not help, then post some code.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Instead of disabling the text box, just set it to read only (hine - ModifyStyle) - the text will stay black.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Problem with setting to read only, is that it will let the user select the text using
the mouse.
Where as in disabled mode, it will not let any mouse selections.
I tried using WM_CTLCOLORSTATIC but not able to make just the text BLACK
|
|
|
|
|
So what's wrong with letting the user select the text - they can't change it, and they may want to copy it and paste it in the clipboard or another app. (You can also disable the tab stop so they can't tab to the control but would have to use the mouse to select the text.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi,
I hope i posted in the right message board.
Here's the thing.
I recently bought a PCI Tv Tuner with a remote control (AverMedia Hybrid 007) and i want to use that remote control to control my PC (maybe create a basic media center application using media players that support slave mode, something like mplayer).
The way i see it i have two options:
1. Using the existing driver that came with the card
2. Writing a new driver that will interface only with the card's ir sensor
And now my questions / troubles:
Using method 1:
Is the driver "generic" enough so i can use it in another application, or is it binded to the application that came with the pci card. I know this question is kind of stupid but i don't know how else to put it?
How can i access the card's driver in Visual C++. I have read that getting a device driver handle is done by using the CreateFile() function, but i can't find the device name (something resembling "\\\\.\\Driver"). Do you know a way to find it out. I don't really need code, but some pointers to existing documentation. Anything will be helpfull.
Using method 2:
To be able to write a driver for the device, do i need to know the hardware specifications of it? If yes, can i use some sort of probing to access it's features?
I come from a web development background, but i have had some experience with C/C++ and i'm a quick learner.
I don't need existing application to resolve my problem because i want to learn how to do it myself; and yes i have searched google but all i got was documentation regarding pci drivers in linux and some vague tutorials regarding pci drivers in windows.
Any kind of help will be appreciated.
Thanks in advance,
Vlad Balmos
modified on Wednesday, December 9, 2009 7:38 AM
|
|
|
|
|
You can use CreateFile to communicate with the driver only if the driver exposes a symbolic link just like COM1 is a symbolic link to the actual serial port. You're card driver's documentation should have this. You can also check using the Winobj[^] tool from Sysinternals.
If you're card has IR, you can communicate using Windows sockets.
Windows sockets supports TCP, UDP, IR and bluetooth.
|
|
|
|
|
I couldn't find the symbolic link for the driver, and i don't think the ir supports socket access. I scanned for ports and didn't find anything related to ir.
But i found another way of doing things:
It seems that the application that came with the pci card, registers the remote as HID, and emulates a basic mouse using a few buttons on the remote. I could use this method or try and hook into the service that listens for remote events and hijack the service calls to the existing media application (i'm not sure if this could be done).
Anyway, thanks for the help _Superman_.
Best of luck!
|
|
|
|
|
I did CreateProcess and then FindWindow to get PowerPoint viewer window handle. How can i resize slide show to specific location & size on my Window? Also any way to prevent powerpoint viewer from starting the slideshow in fullscreen soon after the process is started?
|
|
|
|
|
I don't know of any C++ way of doing this, which makes this forum less useful to you.
My thought was that you could supply powerpoint viewer with a command parameter via CreateProcess that would do what you want.
I found this page:
http://office.microsoft.com/en-us/powerpoint/HA101538891033.aspx[^]
But there's no "start at this rect(100,100,400,200)" parameter, or an equivalent.
The nearest I can find on that list is /M macro which lets you run a specified macro. Maybe you could have a powerpoint macro that does this task for you?
Failing that, maybe the full version of powerpoint will have better command line options - in which case you can solve your problem by spending money.
My thinking is that you'll fail - a presentation is meant to fill up a given screen, in which case why spend the resources needed to make a partial screen view? It's a very edge case use.
I wish you success however!
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
This is not "a very edge case use". This is a very common use. If you totaled all the time PowerPoint files are open on all PCs, I believe you will find many more hours were with people viewing the PPT on their computer (just as they would read a PDF or Word document) and much less time as part of presentations where full screen usually makes sense. I almost NEVER want to view a PPT on my PC in full screen. 1st on a large monitor it is often too big to view comfortably, and I usually want to switch between the PPT and other applications, often leaving the PPT visible to a page while working in a different window.
Making the PowerPoint Viewer 2007 only display in fullscreen is another anti-consumer action by Microsoft to annoy people enough to buy Office 2007. What is needed is the PPT viewer equivalent to the Foxit PDF Reader, for those who want to view but don't need to create PPT files. I don't know of any free alternative viewers that support PPT 2007 format, except maybe OpenOffice and that is pretty heavyweight is all you want is a PPT viewer. It would be great if it were possible to launch the PPT Viewer 2007 from C++ or C# so that it was not fullscreen, but as you mention it does not appear possible from the documentation.
|
|
|
|
|
Wow, you have been looking a long way back in this forum! 8th december...
I have to agree that it would be nice if you could open ppt viewer at a specific location.
But what's in it for microsoft? Partly I'm cynical, and partly I sympathise as I program for a living - but I'm pleasantly surprised there's a free viewer at all. I consider it's very reasonable to expect anyone who wants to do more that just view slide shows to pay money to the authors of the software.
It's not anti-consumer of ford to expect you to give them money if you want to ride in a car.
Someone who makes the presentation is quite capable of printing it to (eg) pdf for other viewing. Or export to flash (allegedly).
Yours a-professional-software-writer,
Iain.
ps... if you want a full screen app in a window... Virtual Machine.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
I used to use the form designer back in visual C++ 2005 express, and there was some ~200 odd controls in the toolbox that I could place in my forms.
Now in visual studio 2008, I get something like 30 controls to choose from, with many useful ones missing. If I right click on the toolbox and select show all, it brings up a much larger list of controls, but 95% of them are greyed out. I can confirm that this doesn't have anything to do with a faulty installation of visual studio, as I use visual studio at university as well, where they are also missing 95% of the controls. I can't even insert a hyperlink control!
image of my toolbox
Anyone got some ideas as to why I can't access the controls, and how to make it so I can? Honestly I think they're trying to push .NET forward as much as possible and in order to persuade developers, they're cutting everything but the most basic stuff from the C++ form designer. Yep. Better put on your tinfoil hats.
|
|
|
|
|
|
Hi,
I am writting an ASP.NET application in VS 2008. I have some COM component written in VC++ 6.0 as a DLL. I Have add reference of COM DLL in my ASP.NET application. In my application I am calling methods from COM DLL which I want to debug but I am not able to debug my COM DLL. Can any one help me how to debug? I am using IE8 on my machine.
thanks in advance.
Yudhisthira
|
|
|
|
|
Do you have the sources of the dll ? If yes, you can simply open the project with VC6 and press F5 to start debugging it. It will ask you to select an executable to run which is using your dll. You can then select IE8 and when your dll will be loaded, you will be able to set breakpoints in it.
You have to make sure that the program is using the same version as the sources you are debugging.
|
|
|
|
|
Hello Friends
I am creating a win32 based window application.I created one modal Dialog
but at the same time while first modal dialog is open I want to open another second modal dialog so for that I created second modal dialog in showWindow of First Modal Dialog.
But It is not opening.
First of all ,I want to know that can we do it ?
Or is any other way to do it?
I want to know one more thing that How can I get the Handle of Modal Dialog?
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
What do you want to achieve exactly ? That you have the two modal dialogs but only the last opened can be used (so the last one is on top and doesn't allow the first one to be clicked) ? Or do you really want to be able to click on the two dialogs at the same time but not on the rest of your application ? I guess from your question that it is what you want to achieve. In that case, your second dialog has to be a modeless dialog (if you search in the articles of codeproject, you'll find plenty of articles discussing them).
|
|
|
|
|
You first need to understand "blocking", "modality" and the relationship between them.
I can only tell you that if you really need two modal dialogs to be displayed simultaneously (why would such a thing be needed completely escapes me), then you could spawn the dialogs from two different threads (one could be the main thread).
But seriously reconsider what you're doing. Perhaps there's something better that you can do.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Your design is wrong! A modal dialog is used to stop an application while the user enters some information, selects options etc, in order to control the work to be done. The whole idea of modal dialogs is to prevent the user doing anything until the requirements of the dialog have been met. If you need more than one dialog at the same time then the design of your application is seriously flawed.
|
|
|
|
|
I suggest you merge the two dialog boxes into one model dialog box, for example, in a side-by-side way. When you want to "dismiss" any one of the original dialog boxes, just hide the appropriate side (by using some resizing and/or moving tricks).
|
|
|
|