I know there're guides on the Internet, and here is what I've done so far.
Run DebugView as Administrator. In DebugView, I have checked "Capture Win32"
I have set the following filter keys & restart the computer:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter" /V DEFAULT /t REG_DWORD /d 0xf
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Debug Print Filter" /v DEFAULT /t REG_DWORD /d 0xFFFFFFFF
I have debugged my app to make sure the OutputDebugString() is indeed executed.
But, the message from OutputDebugString() is still not showed in DebugView (if not debugged with Windbg) and Windbg (if debugged).
Related
First off, I know this is not default behavior. In fact, I've never seen anything like this happen and I'm a long time Powershell user.
I have no problems with the Insert key in any other application. However, in Powershell, its initial state is off, or "overwrite" - which is barely if every used anymore. When I press Insert to turn it on and run a command, it then turns back off.
This has become overwhelmingly frustrating as I frequently press Up Arrow to go to the previous command to edit it, and find that it's in overwrite mode and it really messes me up.
I googled and found nothing, so I decided screw it, I'm getting a new work PC soon anyhow, so I'll just get in the habit of hitting Insert every time I press Enter. Works fine - until I switch PCs and now at home I've been hitting Insert by habit and driving myself nuts.
This behavior happens in all Powershell windows - 64-bit, inside VSCode, etc.
On demand answer:
Check the InsertMode value in HKCU\Console registry key (and all subkeys). If present, then the value should be 1 for most console prompt-like programs, e.g. as follows (output truncated for brief: removed Ubuntu and multiple Command Prompt):
^^> reg query HKCU\Console /V InsertMode /S
HKEY_CURRENT_USER\Console
InsertMode REG_DWORD 0x1
HKEY_CURRENT_USER\Console\Command Prompt
InsertMode REG_DWORD 0x1
HKEY_CURRENT_USER\Console\powershell
InsertMode REG_DWORD 0x1
HKEY_CURRENT_USER\Console\Windows PowerShell
InsertMode REG_DWORD 0x1
HKEY_CURRENT_USER\Console\Windows PowerShell (x86)
InsertMode REG_DWORD 0x1
End of search: 9 match(es) found.
You'll probably want to go to the PowerShell properties to make sure that the Insert Mode is checked (set on) at the Options tab.
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\ folder seems to be the right place where the Windows PowerShell.lnk shortcut is used to be saved. However, there could be more PowerShell shortcuts. Check
where.exe /R "%USERPROFILE%" *Powershell*.lnk|findstr /V /C:"Shell ISE"
or even (run from an elevated command prompt)
2>NUL where.exe /R C:\ *Powershell*.lnk|findstr /V /C:"Shell ISE"
Windows 10 Insider Preview build 10074 has a known issue using the Settings application to enable developer mode. In this build, if you try Settings/Update & Security/For developers... the settings window suddenly closes.
Is there a workaround?
Yes, there's a work-around. In an administrator command prompt, type the following commands:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"
Then reboot the machine to enable developer mode
I'm trying to find if there's a registry key to enable the "Run as Administrator" checkbox on the Start->Run Dialog in Windows 7 (similar to the "Run in Seperate Memory Space" checkbox which can be enabled in the registry). At a couple of sites I remember I had this option, however on my current PC it's not enabled/visible.
If you know of a way to enable this checkbox via registry, or if it's available by a 3rd-party toolkit, please point me in the right direction?
I already know how to create a shortcut and set "Run as Administrator" on a specific application, and the "runas" command, I'm looking to enable the checkbox in the Start->Run command specifically in this instance.
Thanks.
Disabling UAC will give that option
To disable:
reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
To re-enable
reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
After restarting you will see the run box with admin privilege
In the post-build Event, I have had the following command line,
REG ADD HKLM\SOFTWARE\Microsoft\Office\12.0\Common\General /v EnableLocalMachineVSTO /t REG_DWORD /d 1
, which adds a DWORD type value under the registry key General.
I don't know what else I am missing here - the command line REG ADD just doesn't seem to work for me. After the installation, that key is still missing. If I run it alone using Command Prompt, it's all good though.
There is some issue with visual studio build events.
Even with admin privilege, it cannot register in HKLM.
instead if u try with HKEY_CURRENT_USER, it works great.
REG ADD HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\12.0\Common\General /v EnableLocalMachineVSTO /t REG_DWORD /d 1
Why I want to do this?
First, I never use it - spare me, this is going to sound ignorant, but I'm not interested. My debugging comes down to print and if statements. I've been doing it that way for a while, and have no interest in changing the way that works.
Second, a lot of programs which work until Visual Studio installation suddenly stop working upon it, just as Just-In-Time debugging starts to kick in.
Third, it's crashing some of my old programs (not my own, but programs I use) wherever a second screen is attached. Have no idea why this is happening.
Is there a way to turn it off completely?
I've disabled it in Visual Studio's options, but it still comes up with an error
An unhandled win32 exception ... Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time can be enabled from ...
Check the documentation index for ...
(so in general, it's telling me that it isn't turned on)
How to disable it completely without uninstalling Visual Studio?
The way to do this is to select Debug > "Start without debugging (Ctrl+F5)" from the menu, instead of "Debug > Start (F5)".
You might also want to build your code in release mode when doing this - as the debug builds won't be of any benefit to you if you're not intending to debug them.
The issue of a windows program launching the debugger is not really one of changes in Visual Studio but is affected by changes in Windows which controls the JIT. You can build all code in release mode, but often want is just no debug pop ups. This is described in this article http://msdn.microsoft.com/en-us/library/k8kf6y2a(v=vs.80).aspx.
You need to issue the commands:
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting" /f /v "Disabled" /t REG_DWORD /d 00000001
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting" /f /v "DontShowUI" /t REG_DWORD /d 00000001
At that point you can run your programs without invoking the debugger. I do this in a batch file:
for /f "delims=" %%a in ('where reg 2^>nul') do #set theValue=%%a
if NOT "%theValue%."=="." GOTO :HaveReg
:: Might not have where - check again
for /f "delims=" %%a in ('reg /? 2^>nul') do #set theValue=%%a
if NOT "%theValue%."=="." GOTO :HaveReg
echo Unable to change registry keys to turn off program pop-ups
GOTO :DoneRegCheck
:HaveReg
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting" /f /v "Disabled" /t REG_DWORD /d 00000001
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting" /f /v "DontShowUI" /t REG_DWORD /d 00000001
:DoneRegCheck