Unable to paste into Edit Control Input box in MFC application in Microsoft Server 2019 standard and Server 2012 R2 - winapi

I have a MFC application that has 2 input boxes(Edit Control). This application is called from MSI Custom action during installation. When I try to paste(Ctrl + V and Right click -> Paste) into those input boxes, It is not working. But I can copy paste contents of input boxes to other applications. Copy paste works fine when application is run standalone but not works when msi custom action calls.This only happens in Windows Server 2019 Standard and Windows Server 2012 R2.
I tried using CEdit::Paste() function for Ctrl + V keypressdown action. Then tried to get Clipboard contents using OpenClipboard() function. But I got nothing from clipboard.

Related

Visual Studio Resource Editor ActiveX control ... could not be instantiated after I just added it with the resource editor?

Trying to follow multiple tutorials on adding RDP client support to an MFC project and I can add the ActiveX control just fine, but when I close the dialog in the resource editor then try to open it back up, I always get:
Microsoft Visual Studio
The ActiveX control "Microsoft RDP Client Control - version 11" could not be instantiated.
I then have to manually edit the .rc file and remove the control it added from the dialog. How do I stop it from doing this?
Two different tutorials can be found here and here

Visual Studio 2017 - Open in Visual Studio from Explorer - Permission Error

I am using VS 2017 Enterprise.
I have it setup to open/run in Administrator mode which is working for SLN files.
However I'm trying out the new "Open in Visual Studio" feature by right clicking on a folder in Explorer. I'm receiving the following permission error. It's happening for every folder I try.
VS Code has no problem however.
Is there something more I need to enable?
My first guess would be that the VS 2017 application itself (devenv.exe) is configured on that machine to always Run as Administrator see https://technet.microsoft.com/en-us/library/ff431742.aspx on how to change it:
To mark an application to always run as an administrator, do the following:
1. On the Start menu, locate the program that you want to always run as an administrator.
2. Right-click the application’s shortcut, and then click Properties.
3. In the Properties dialog box, click the Compatibility tab.
4. Do one of the following:
- To apply the setting to the currently logged-on user, select the Run This Program As An Administrator check box, and then click OK.
- To apply the setting to all users on the computer and regardless of which shortcut is used to start the application, click Change Setting For All Users to display the Properties dialog box for the application’s .exe file, select the Run This Program As An Administrator check box, and then click OK twice.
See also list of things that you can't do without administrator account https://msdn.microsoft.com/en-us/library/jj662724.aspx. What typically makes Web-developers to make VS always run as administrator is "Deploying a web application to Internet Information Services (IIS) on a local computer." and "Debugging applications that a run under a different user account, such as ASP.NET websites."
For me it has worked as it should, at least this can help you.
First question is how you "setup to open/run in Administrator mode" ?
Using the "Advanced button" of the Visual Studio 2017 shortcut is not enough because methods with the right mouse button don't use this shortcut.
Using the method of the compatibility tab as mentioned already by SergGr
(https://technet.microsoft.com/en-us/library/ff431742.aspx) has worked for me, and I have been able to use it for folders as well as for solution files !
I am logged in as a member of the local admin group and UAC standard setting into Win 8.1 .
Another possibility instead of using the compatibility page would be to inject an own manifest into devenv.exe. Neither of the two is very clean (I am no fan of the whole compat layer, but it helps here a bit).
Have you tried to switch UAC off temporarily for a test? Or how you have configured UAC?
If you have done it the way described, the explorer should come up with a correct UAC message.
This works for me if not for you then refer to (https://marketplace.visualstudio.com/items?itemName=GregTrevellick.OpeninVisualStudio2017Enterprise):
1. open notepad.exe and paste this into it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
#="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
here is my registry file exported just incase you need it (you shouldnt):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
#=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,53,00,20,\
00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,00,78,00,\
65,00,22,00,20,00,22,00,25,00,31,00,22,00,00,00
2. save as VSElevated.reg
3. go to where you saved the .reg file and double click, yes to everything and ok.
4. This is how your Registry should look like afterwards:
The reason i think is the %1 is missing in your launch command. This should solve it.

How to open Run dialog box in Windows server 2008 without using "WindowsKey+R"?

Is there any shortcut key to open Run dialog box in windows server 2008 without using "WindowsKey+R" combination?
You can make a normal shortcut file to it and then assign any keyboard shortcut to the shortcut file.

Windows CE emulator on visual studio

I've installed visual studio 2005 and windows embedded c.e. 6.0.
How do I create a simple hello world program in visual studio and then port it to a Win C.E. emulator and run the same there.
Does this page help?
Quoted from there:
Your First Visual C++ for Windows CE
Application
Your first Visual C++ for Windows CE
application will be a simple
application, a WCE MFC AppWizard (EXE)
to be precise. This application will
have a single view that will have a
bitmap painted on it. We will also add
a menu item that when clicked will
evoke a dialog. This dialog will
contain one of the Windows Common
Controls, a progress control. Creating
the Basic Application
Download the sample application source
code.
To start your first Windows CE
application we will generate a shell
using the WCE MFC AppWizard. The
numbered list below will step you
trough this process:
1. Open Visual C++ and go to the File menu and choose the New item
2. Select the Projects property tab if it is not already selected.
3. Select WCE MFC AppWizard (exe) in the list control.
4. Type WCEFirstApp in the Project name edit box
When you finish, you will see the New
dialog box as seen in Figure 3.
Press the Next button.
WCE MFC AppWizard (exe) - Step 1 of 4
will appear as seen in Figure 4.
Notice that the selections are similar
to the MFC AppWizard except that there
is no Multiple documents selection.
6. Accept the defaults.
7. Press the Next button.
WCE MFC AppWizard (exe) - Step 2 of 4
will appear as seen in Figure 5. There
are several options on this page. You
can add support for Windows Sockets,
ActiveX Controls, Windows Help, and
Printing if your target supports
Windows CE 2.1. You also can choose
the type of command bar that you wish
to support. For this exercise we will
accept the defaults.
8. Accept the defaults.
9. Press the Next button.
WCE MFC AppWizard (exe) - Step 3 of 4
will appear as seen in Figure 6. You
can choose to include generated
comments, an option that I highly
recommend. There is no such thing as
too much documentation. There is also
an option to link dynamically or
statically with the MFC Library.
Accept the defaults.
10. Accept the defaults.
11. Press the Next button.
WCE MFC AppWizard (exe) - Step 4 of 4
will appear as seen in Figure 7. This
page gives you an opportunity to set
the base class for the view. It also
gives you an opportunity to set your
file names. Accept the defaults.
12. Accept the defaults.
13. Press the Finish button.
The New Project Information dialog
will appear as seen in Figure 8. Just
like all Visual Studio AppWizards the
wizards give you a final chance to
look over your choices.
14. Press the Ok Button.
15. Select Build menu and choose the Rebuild All item.
When the application is completed
building, you are ready to go on to
the next section.
Also see this.

Visual Studio:How to show a link after installation had finished?

Within an installer build using Visual Studio 2008 I like to show a link to a website at the end of the installation that the user can click to open the URL inside the standard browser.
Is this possible and if so how?
The Hyperlink control is only supported in Windows Installer 5.0 (i.e. Windows 7, Server 2008 R2)
To do this with older versions of Windows Installer, you'll need to create a CustomAction that launches the website, and then tie the execution of the CustomAction to a button, another common use is to create a checkbox saying "Launch blah blah..." and then tie a CustomAction to the 'Finish' button which executes based on the value of the checkbox.
Maybe a custom dialog window is what you need. See here: http://www.codeproject.com/KB/install/vsSetupCustomDialogs.aspx

Resources