I have an ESRI Add-In for ArcGIS for Desktop (10.2.1) written in C# with ArcObjects SDK.
The Add-In includes a DockableWindow. When this DockableWindow is hidden, I would like to be able to flash the DockableWindow's tab inside of Arcmap.exe (NOT the icon for the whole app on the taskbar).
I have not yet found a solution that works. Does anyone have any ideas how to do this? Thanks.
I've already tried flashing via FlashWindowEx, which only succeeds in flashing the icon on the task tray. Passing in the hwnd for the tab inside of Arcmap does not work to flash the tab. In fact I tried EVERY child hwnd for the entire app with no success.
If I had the code for the tab, I would just make it change colors myself, but the tab is auto generated by arcmap.exe when my window is set to auto hide.
Related
I have added the source code for wix theme and customized the default one with what i required.
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication LicenseUrl="" ThemeFile="HyperlinkTheme.xml" LocalizationFile="HyperlinkTheme.wxl" LogoFile="header3.jpg"/>
</BootstrapperApplicationRef>
Now when i click the installer, the installer main window opens with Install and Cancel button.I need to show a custom screen with product name and version and OK button before this screen loads.On clicking OK should close this custom screen and open the main installer screen.
I googled and found that if i am not using any default screen i can customize the screen.Since i am using default installer screen i don't know how to do this and how it works.Need some idea to do this in Burn/Bundle.wxs.
WixStandardBootstrapperApplication does not support this today. The logic behind navigating between pages is hard coded.
I apologize for the length of this question, but some background explanation is required.
Background:
I'm working on an internal web application that will display a pdf in an iframe. Adobe Reader X offers a "Read Mode" for displaying the pdf in the browser. This removes the shell and adds a menu box to the bottom of the pdf when the mouse is over the "middle center". In versions prior to X you could use JavaScript to modify the toolbar menu items.
What I Need:
I need to display the pdf in "Read Mode" AND remove all menu items. The computers that are to run this app are basically a kiosk and are literally a computer, monitor and mouse. No printers, no keyboard, no other interactivity.
My question is this:
How can I load a pdf for reading in internet explorer, and disable all interaction except scrolling. That is, no menus, no context menu, and no "shadow bar" when the bottom center is moused over. I've been searching for alternatives to Adobe, and there are some great ones, but the ones I've found that have a browser plugin, do not have a plugin for IE.
If someone know a way to just load the PDF Contents that would be an even better route.
More Information:
If it helps, while this is being built for Internet Explorer, the web-page will be loaded into a windows form that is just a full-screen browser control.
Other things I've tried:
I have also tried positioning a transparent iFrame on top of the pdf iFrame, covering only the displayed content, but leaving the scrollbars intact. This worked perfect if I loaded anything BUT a pdf. If I loaded any other website then it worked as expected (except the scroll wheel of course doesn't scroll the webpage). If a pdf was loaded, then all that would appear is a white square. Use the dev toolbar to remove the transparent iFrame and the PDF looks good.
I've found a good partial solution. A product called PDFObject.
Using it, I can add the following JavaScript to my page:
function embedPDF() {
var myPDF = new PDFObject({
url: 'PathToPdf.pdf',
pdfOpenParams: {
scrollbars: '1',
toolbar: '0',
statusbar: '0',
messages: '0',
navpanes: '0'
}
}).embed('DivToLoadPdfInto');
}
window.onload = embedPDF;
This will embed the pdf into a div and remove the toolbar, statusbar, message, navpanes, but still allow scrollbars. This prevents the shadow box menu from appearing, which is great!
Users can still right-click on the pdf so I'll try the standard Right-Click blockers in JavaScript and edit if I can get something to work.
Edit:
A good resource for URL Parameters can be found here.
Ok, so I have come up with a final solution.
Needs:
Load PDF in iFrame in "Reader Mode" but with no shadow bar
PDF Context Menu should be disabled
Addressing the first need is easy with some caveats. Set the source of the iFrame to "pathToPdf/document.pdf#toolbar=0&navpanes=0". The caveats here are that (in IE at least) once this breaks, then the browser needs to be closed and re-opened to work again. So, what can break it?
User right clicks and opens the navigation pane buttons.
User presses the escape button on the keyboard.
The webpage is loaded into the browser control of a windows form, and luckily once broken there it works fine without closing and reopening. Could still be a problem though for the PDF being viewed. I don't have to worry about the escape key, because the app is running on a KIOSK(basically) and there is no keyboard, only a mouse.
Disabling the context menu has proved to be the most difficult thing to do. The web browser control has a "IsWebBrowserContextMenuEnabled" property that when set to "False" will disable the context menu for the browser. Probably because the adobe reader is a plugin, this does not effect the PDF. With Reader X there is no registry setting (that I could find) or JavaScript method, or general setting that will disable context menu.
I was ready to give up when I remembered something. This is a kiosk, and there is no need for the right mouse button. So the solution; modify the registry and turn off the right click for the internal OS. To do that simply open regedit and goto:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Find (or create if it is not there) a DWORD key named "NoViewContextMenu".
A value of 1 will disable right clicking, 0 will enable.
Summary:
Use "pathToPdf/document.pdf#toolbar=0&navpanes=0"
Disable right click in windows registry
Edit:
The registry hack only disables the right mouse button in windows explorer. We are having no luck in finding a good software solution, so we are left with either writing our own custom mouse drivers or simply popping open the mice and removing the physical trigger mechanism.
I am unable to figure out why I can use Spy++ to get handle, window class etc of some windows application. For example, iexplore.exe, it just doesn't work on url text box or any text, edit box area if any in the page loaded; there are also windows application I get only the outer layer's properties whereas its internal buttons, textbox or combox are inaccessible. In these applications what should I do to reach them ? Thank you :)
These programs use windowless controls.
Instead of using standard Windows controls, they draw and process everything themselves within one giant container.
I've got a Windows Forms application in C# that starts off with a loading dialog. As expected, a button for the app shows up in the Windows taskbar.
I would like to detect right-clicks that might be done to that button.
Ultimately, I hope to disable the right-click or simply have the loading dialog regain focus. I've seen that some people use custom libraries and packages (interop, for example) to achieve some Win32 functionality, but I'd personally like to avoid this. Is it impossible to do without such libraries/packages?
How about just not showing the form in the taskbar by setting Form.ShowInTaskbar to false?
I need to be able to embed and control the playback of an AVI file in a WinForms app, using C#. The video needs to be embedded in the form, not launched in a separate media player window.
What's the best approach to do this? I found the System.Media namespace, which sounded promising, but it appears that is only useful for sound.
Do I use DirectX to do this? MCI? Or some other approach?
You can use Media Player inside your Winform. This would been an easy way to do it.
The way i did it was, and I quote:
Right-click the Toolbox, and click Choose Items.
Note: If you do not see the Toolbox, click Toolbox on the View menu to
open it. The Customize Toolbox Items dialog box opens.
On the COM Components tab, select the Windows Media Player check box,
and then click OK.
The Windows Media Player control appears on the current Toolbox tab.
When you add the Windows Media Player control to the Toolbox, Visual
Studio automatically adds references to two libraries: AxWMPLib and
WMPLib. The next step is to add the control to the Windows Form.
To add the Windows Media Player control to a Windows Form
Drag the Windows Media Player control from the Toolbox to the Windows
Form.
In the Properties window, set the Dock property to Fill. You can do
this by clicking the center square.
Double-click the title bar of the form to add the default Load event
in the Code Editor.
Add the following code to the Form_Load event handler to load a video
when the application opens.
axWindowsMediaPlayer1.URL =
#"http://go.microsoft.com/fwlink/?LinkId=95772";
http://msdn.microsoft.com/en-us/library/bb383953(v=vs.90).aspx
I highly recommend this library:
http://directshownet.sourceforge.net/
It is a .NET wrapper around the DirectShow API.
(The sample apps should get you going very quickly.)
--Bruce
The suggestions from Daok and Brian Genisio are both good options. Let me add a third: DirectShow. Used to be part of DirectX but has now been promoted to the Windows SDK. There are many good C# sample applications to look at, and it gives complete control of the playback.
I would consider using the WPF media controls and just use the ElementHost to put your WPF control inside your WinForms app. I think you will get a much more rich experience.
See System.Windows.Forms.Integration for more information