Stamps palette questions...

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Stamps palette questions...

Post by lidds »

I am using the following command to open the Stamp Palette and I was wondering if there is a way to do the following:

Code: Select all

Me.docPreview.ShowPane("stampsView", Mode)
1. Bring the Stamp Palette form to the front or top most?
2. Also hide the close button (cross button on top right of the pane)?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Stamps palette questions...

Post by Sasha - Tracker Dev Team »

Hello Simon,

To hide the close button, try this:
https://www.pdf-xchange.com/forum3 ... 66&t=29528
As for the pane positioning try playing with this:
https://www.pdf-xchange.com/forum3 ... 29#p115881

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Stamps palette questions...

Post by lidds »

Alex,

I am using the following code to hide the close buttons on panes, however I cannot seem to find any Stamp Pane?

Code: Select all

            Dim layout As PDFXEdit.IUIX_Layout = Me.docPreview.Inst.MainFrm(2).View.DocViewsArea.Panes.Layout
            Dim pane As PDFXEdit.IUIX_Obj = Me.docPreview.Doc.ActiveView.CommentsView.Obj
            Dim paneLI As PDFXEdit.IUIX_LayoutItem = layout.GetItem(pane)
            paneLI.SetStyle(CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoClose), CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoClose))
Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Stamps palette questions...

Post by Sasha - Tracker Dev Team »

Hello Simon,

You will have to distinguish between the panes that belong to the Documents View and to the Main View. Basically this code should have worked, though it does not:

Code: Select all

int nID = pdfCtl.Inst.Str2ID("stampsView");
IUIX_Obj pane = pdfCtl.Inst.MainFrm[0].View.Panes.Active[nID].Obj;
IUIX_Layout layout = pdfCtl.Inst.MainFrm[0].View.Panes.Layout;
IUIX_LayoutItem li = layout.GetItem(pane);
li.SetStyle((int)UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoClose, (int)UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoClose);
I will ask a developer who made it to clear things out.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Stamps palette questions...

Post by lidds »

OK Alex, thanks
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Stamps palette questions...

Post by lidds »

Also,

With your code specified, I cannot seem to make the pane topmost, if this is not possible then even to make the pane show an icon in Taskbar would be another solution.

Thanks

Simon
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Stamps palette questions...

Post by lidds »

Alex,

Your code does work, but only if the Stamp Palette is docked. If you make it a floating dock pane then the code does not work. Just thought I'd mention it so you can relay this to your developer.

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Stamps palette questions...

Post by Sasha - Tracker Dev Team »

Hello Simon,

You will have to work through the window's handles - this is how you remove a close button:

Code: Select all

[DllImport("user32.dll", EntryPoint = "GetWindowLong")]
static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);
public enum GWL
{
	GWL_WNDPROC = (-4),
	GWL_HINSTANCE = (-6),
	GWL_HWNDPARENT = (-8),
	GWL_STYLE = (-16),
	GWL_EXSTYLE = (-20),
	GWL_USERDATA = (-21),
	GWL_ID = (-12)
}
[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong);
private void setNoCloseStyleViaHWNDToolStripMenuItem_Click(object sender, EventArgs e)
{
	int nID = pdfCtl.Inst.Str2ID("stampsView");
	IUIX_Obj pane = pdfCtl.Inst.MainFrm[0].View.Panes.Active[nID].Obj;
	while (pane != null)
	{
		uint hnd = pane.GetFirstWndHandle();
		IntPtr p = new IntPtr(hnd);
		IntPtr hStyle = GetWindowLongPtr(p, (int)GWL.GWL_STYLE);
		int dwStyle = hStyle.ToInt32();
		if ((dwStyle & 0x80000000) != 0) //WS_POPUP
		{
			dwStyle = dwStyle & ~0x00080000; //WS_SYSMENU
			SetWindowLong(p, (int)GWL.GWL_STYLE, (uint)dwStyle);
			break;
		}
		pane = pane.Parent;
	}
}
As for the topmost - this sample gives you the needed window handle - you will have to use it to achieve the needed window style.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply