I have been searched about creating input dialog in windows form using visual c++ but I didn't found useful resource
Is there any exist function do this task ?
I know how to create an empty dialog but how I can add text box and buttons ?
Form ^ dlg1 = gcnew Form();
dlg1->ShowDialog();
No. You have to design a dialog with a field for information entry, put it up and retrieve the information entered.
Yes, actually. Just use a standard VBScript InputBox, which can be used in C++ via the IActiveScript interface. See my answer to a similar question for the full code example:
https://stackoverflow.com/a/52808263
It will automatically resize the dialog to the contents you specify in the arguments, so don't worry about creating your own dialog. Microsoft made one for you, so why not just use it? :)
Related
How do I design a GUI (Multiple Document Interface) in VC++ using MFC which can take two input parameters from users and then prompt the user for entering user name and password and then use these details for later usage in the program?
This has to be done in Visual Studio 2015.
I couldn't find any proper help on the internet.
If in case you have any mocks please do share so that it would help us understand better your requirement.
Please refer to this for a quick intro:
https://msdn.microsoft.com/en-us/library/ms973874.aspx
The basic idea is you create dialogs for your application and the code behind class of your dialog will store the data in your case the user entered parameters.
In case you are new to MFC I would suggest writing a dialog based sample initially and then pick up on the MDI and SDI applications.
In case have some other confusins let me know
I'm creating an installer at work that must open a file browser. There is no file browser in wix, so I built a custom vbscript action that uses the Shell.BrowseForFolder method. It's working fine, but the file dialog shows up behind the main wix window. Does anyone know a wix/vbscript approach I could take to solve this problem?
Locate the HWND for the MSI UI and pass this into Shell.BrowseForFolder. I see a few example solutions that use FindWindow("MsiDialogCloseClass", vbNullString). Be careful about launching UI from a custom action: you need to consider silent installs/repair/uninstall, etc to make sure you get it right in all cases.
It looks like you're trying to allow the user to pick a directory. MSI has native support for this. I reccomend you use that. For an example see http://wix.codeplex.com/SourceControl/latest#src/ext/UIExtension/wixlib/BrowseDlg.wxs.
I'd like to write an Outlook add-in that would parse text being typed by the user.
The goal - if the user types a sequence of characters, the add-in would perform some action.
Example: As the user types "##someone" the add-in would recognize the pattern "\#\#\w{1}" and perform some action.
The problem is I have not found a way to inspect what the user is typing.
Is this restricted? If so, looks like the only option would be to hook into the Send() event and inspect the message then - less ideal.
I'd like to write this add-in in Visual Studio 2010 for Outlook 2010
Any ideas welcomed.
I believe what you're looking for is "Smart Tags". This should provide you a good overview and a direction to go: http://msdn.microsoft.com/en-us/library/vstudio/ms178786%28v=vs.100%29.aspx
Here's the SDK: http://msdn.microsoft.com/en-us/library/vstudio/aa169576.aspx
And a basic tutorial: http://www.add-in-express.com/docs/net-smart-tags.php
Hope this helps.
Have you tried to use MailItem.Body?
Also, Application.AcvtiveInspector.WordEditor will return an instance of the Word's Document object that you should be able to access and manipulate the text as the user types it.
I'm working on a little macro record/replay tool which can automate a few very old Visual Basic 6 GUIs we have. To do so, I'm identifying the controls by their name (the value of the name property of a control, that is).
One part of this tool needs to determine the name of a control given its HWND. For newer Visual Basic applications which were done using VB.NET, I can use the WM_GETCONTROLNAME window message. This works nicely.
However, this message is not understood by older windows. Is there any way to do this for controls of Visual Basic 6 applications? A solution which does not require being in the process of the GUI would be preferrable, but if I had a solution which only works inside the GUI process then that would be acceptable as well (since I can do the injection myself).
UPDATE: One thing I just tried, this moderate success: I used the AccessibleObjectFromWindow to check for implementations of the IAccessible interface of the object which shows the given HWND. In case I get an implementation (it seems that many [all?] Visual Basic controls implement this interface), I use the accName property to read out the "accessible name". Sometimes this does yield a useful string, but usually it doesn't.
I believe the only way would be getting inside the process and obtaining a pointer to the Form object, yet I have no idea how to do it from outside.
Is it possible you add support for the WM_GETCONTROLNAME to those older applications?
Or maybe, you could identify the controls by some other, natively-available properties?
Other that that, as Raymond is saying, there isn't much you can do.
Can you modify the vb6 apps? if so in each form load event you could iterate me.controls and use the SetProp(ctrl.hwnd, "MYNAME:" & ctrl.name, 0) api to add the name to the window's own property list, then in your other app you can EnumProps(ctrl_HWND) looking for the one that begins with MYNAME: and parse out the value.
The subject says it all. Is there an easy way to toggle the editability of a buffer in Visual Studio? This would be similar to the toggle-read-only command in Emacs.
I am not looking to change the file attribute ... just whether I can edit the file while it is open in Visual Studio. I am using 2008 and 2005.
Why would I want to do this? I tend to have several files open at the same time .... for days at a time sometimes (perhaps a bad habit) and I have +/- a char or few here and there without meaning to or noticing ... also worried about "the cat walking across the keyboard"
Besides ... an "ancient" code editor like emacs has it :) and I grew to expect the feature.
TIA!
There is an extension for Visual Studio called CodeMaid that will give you a Read-Only Toggle per file.
http://www.codemaid.net/documentation/#andmore
You can download it at http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496
You can use this piece of vba
Public Sub ToggleReadOnly()
Dim doc As Document
doc = DTE.ActiveDocument
If (doc.ReadOnly) Then
doc.ReadOnly = False
Else
doc.ReadOnly = True
End If
End Sub
Note: the msdn documentation specifically mentions that the property ReadOnly shouldn't' be used explicit but I verified that this works for me on vs.net 2005.
I also verified that the actual file attribute isn't changed.
I'm not aware of anything that will quickly achieve what you're looking for. Furthermore, I'm not really sure why you would need such a thing. Typically I use subversion to tell me which files have been changed and where they have been modified that way I can revert anything that doesn't belong.
Can you expand on your question a little to let us know what your usecase is?
If you really need to toggle readonly....perhaps you can:
Right click on the file
Select Open Containing Folder
Right click on the file and choose properties
Check the readonly checkbox
Start Tools->Macros->Macro IDE. Add new module (described here in details) and define there procedure as follows:
Imports EnvDTE
Public Sub SwitchReadOnly()
DTE.ActiveDocument.ReadOnly = Not DTE.ActiveDocument.ReadOnly
End Sub
Assign macro to keyboard key(described here in details). That's all.