IP Address Control in wxWidgets - mfc

In MFC there is a control to enter IP(v4) address called CIPAddressCtrl. Does wxWidgets have an equivalent? Or, do I need to create a custom control?
Thanks

No, wxWidgets doesn't wrap the native Windows IP address control because nothing like this exists under the other platforms and it seems a bit pointless to provide something for Windows only.
The best you can do is indeed use a custom control, which could be as simple as just a plain wxTextCtrl with an appropriate validator.

Related

How to replace/update an ActiveX control in a MFC dialog

I have an older MFC project build in VS 2003 that I want to port to VS 2010. The project uses an ActiveX control for grids, namely, VSFlexGrid7 from Component One. The problem is, that this version of the ActiveX control does not work in Windows 7 (which is what I have). There is a newer version of the grid, namely, VSFlexGrid8 which should be compatible with Windows 7.
The solution would be to replace all the older controls with the newer ones.
My question is, what would be the steps in replacing the controls, without touching other parts of the project. What is the simplest method to accomplish this? Do I have to modify classes, resource IDs, etc.?
[Solution: Replace CLSIDs in the .RC file]
The ActiveX control is bound to the resource file via the guid that represents the control. If you were to look inside the .rc file you will see the control with the associated guid. In your case, it's probably best to completely remove the control from the dialog (using the resource editor) assuming that you can drag the newer version onto the same dialog. Once you've done that, you'll need to generate a new class wrapper for the control. The class wizard should be able to handle that for you. Once you've got a new class wrapper that represents the control, you'll need to replace the prior wrapper class in your source code.
Usually the control is created somewhere in your dialog code with CreateInstance.
If the interface is compatible (I assume it is) , you just have to change the name or GUID that is used in the CreateInstance Code.

Can windows 7 and 8 common dialogs be hooked

I am trying to replace all Windows Common (Open/Save) filedialog calls with my own custom dialog. From what I read so far, I could do this with a hook on the calls either by writing my own or by using libraries like detours or easyhook. But someone told me recently that such an approach is only possible pre-Vista, because of the change in sessions architecture and it is impossible to do such a switch in Win 7/8. Now, I am not a guy who likes the word 'impossible' :) So if you have any advice on the matter, any at all, please do tell and I will appreciate your kindness.
For what I what to do, my application will be run by the user, it will reside in the tray, and when the user calls for Open/Save dialog from any application, it should replace the default common dialog with a custom dialog.
The newer style Common Item dialogs are implemented as standard COM objects, so you could just implement your own DLL that exposes the same COM interfaces (IFileOpenDialog, IFileSaveDialog, etc) and then override the default registrations in the Registry with your own. That way, every app that uses the dialogs will load your DLL instead of Microsoft's.

Is there a way to save window sizing information in wxWidgets 2.8+

I know there is a way to save Window placement structures in Windows, but I'm wondering if there is an alternative way that can be used for cross platform wxWidgets app.
Also, what would be the best way to serialize this data without platform specific code.
So, if all you want is to store the size and location of windows, then handle the window resize and move events so that they store this data in wxConfig.
http://docs.wxwidgets.org/2.9.3/overview_config.html

Is there Path Edit Control in Win32?

I would like to add an edit box (or is it a combo box?) for entering a file-path using Visual C Win32 so that it offers auto-complete - the same as when you type in Windows Explorer's address bar.
Is there a common control or property I'm missing that allows me to do that?
You can use the standard edit control and call SHAutoComplete. Like this:
SHAutoComplete(editWnd, SHACF_DEFAULT);
The system will do the rest for you.
There is no Common Control for that. What you can do, however, is use a standard Edit control and attach the IAutoComplete interface to it, which can be configured to use the file system (amongst other things) as a source for getting string values from. The easiest way to do that is to call the SHAutoComplete function.

wxWidgets create an app that lives on the desktop?

Is it possible, using wxWidgets and C++, to create an application that will show on the desktop? What I mean, is that it would only display on the desktop, like Geektools, Rainmeter, etc.
Not out of the box.
You could try to get the HWND of the Desktop and create your own control in wxWidgets by deriving a class from wxControl or wxWindow and do the Drawing yourself. It is not that hard to do it :). You could even use wxHTMLWindow or wxWebConnect (3rdParty, based on Webkit) for that.
See GetDesktopWindow() for that:
http://msdn.microsoft.com/en-us/library/ms633504(VS.85).aspx
Assuming you are on Windows. You have to check for your WindowManagers Documentation on Linux yourself though. If you are using KDE, I would suggest to use QT directly or the KDE API. Same for Gnome.
It would be easier to use the corresponding os/windowmanager api for that though.
Hope that helps.