Home > Software engineering >  The document opens, the text above document information technology implementation
The document opens, the text above document information technology implementation

Time:09-21

As title, just like in the document menu below the hanging a banner, it shows some information,
Which tall person to give directions, this is to use technical means to achieve?
Effect:

Is in the document is opened to the document into a DLL file? And then realize the picture painted in the DLL file?

CodePudding user response:

Modify the UI must be into the process space, injection and then to do everything

CodePudding user response:

reference 1st floor smwhotjay response:
modify the UI is sure to enter the process space, injection and then do


Good point! But I the effect after injection into the case,

Part of the original are covered,,, don't want to the Notepad. Exe to do secondary development, according to the position of the text shows the height of the image to move down?

CodePudding user response:

Lower part of open notepad resize put the upper window, the window display information,

CodePudding user response:

reference schlafenhamster reply: 3/f
open notepad adjustment put the upper window size, window bottom display information,

Can say more detail? I understand your thinking:
1) the text information display area to adjust the picture height distance,
2) image width is set to the width of the Notepad window, so as not to have acosmia feeling,
What do I need to call interface to implement the above 1) 2) function? Thank you first!

CodePudding user response:

Reference:
 
//by creating process * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
BOOL GoNotePad (char * path, BOOL bWait=TRUE)
{
Char pathexe [MAX_PATH];
Strcpy (pathexe, "notepad. Exe");
Strcat (pathexe, path);//the pathname="notepad. Exe",
STARTUPINFO sinfo;
PROCESS_INFORMATION pinfo;
Memset (& amp; Sinfo, 0, sizeof (STARTUPINFO));
Sinfo. Cb=sizeof (STARTUPINFO);
Sinfo. DwFlags |=STARTF_USESHOWWINDOW;
Sinfo. WShowWindow=SW_SHOWNORMAL;//SW_SHOW;//SW_SHOWDEFAULT;
//BOOL fsuccess=0;
BOOL fsuccess=CreateProcess (NULL,//lpApplicationName
Pathexe,//lpCommanderLine
NULL,//lpProcessAttributes
NULL,//lpThreadAttributes
FALSE,//bInheritHandles
NORMAL_PRIORITY_CLASS,//dwCreationFlags
NULL,//lpEnvironment
NULL,//lpCurrentDirectory
& Sinfo,//lpStartupInfo
& Pinfo);//lpProcessInformation
//wait for NotePad finishes
If (fsuccess)
{
HANDLE hProcess=pinfo. HProcess;
The CloseHandle (pinfo. HThread);//close the thread at once
If (bWait)
{
If (WaitForSingleObject (hProcess, INFINITE)!=WAIT_FAILED)
{
DWORD dwExitCode;
GetExitCodeProcess (hProcess, & amp; DwExitCode);
If (dwExitCode==STILL_ACTIVE) AfxMessageBox (IDS_NOTEPAD_ALIVE);
}
}
WaitForInputIdle (pinfo hProcess, INFINITE);//let NotePad show window
The CloseHandle (pinfo. HProcess);
}
Return (fsuccess);
}
//
Void CMdiInDlgDlg: : OnAdd ()
{
//TODO: Add your the control notification handler code here
If (GoNotePad (" ", FALSE))
{//
M_hwnd=: : FindWindow (" NotePad ", "no title - NotePad");
If (m_hwnd)
{
LONG style=GetWindowLong (m_hwnd, GWL_STYLE);//14 cf 0000
//1=WS_VISIBLE 4=WS_CLIPSIBLINGS C=WS_CAPTION; WS_THICKFRAME=4 + 8 + WS_GROUP WS_SYSMENU==2 + WS_TABSTOP=1==F
Style & amp;=~ WS_CAPTION;
Style & amp;=~ WS_THICKFRAME;
Style & amp;=~ WS_MINIMIZEBOX;
Style & amp;=~ WS_MAXIMIZEBOX;
Style & amp;=~ WS_SYSMENU;
Style & amp;=~ WS_GROUP;
Style & amp;=~ WS_TABSTOP;
//style |=WS_CHILD;//if 2 then no menu!!!!!!
The SetWindowLong (m_hwnd, GWL_STYLE, style);
CRect rc;
GetClientRect (rc);
Rc. Bottom -=50;//at the bottom left 50, display file information!
//afxDump & lt; : : SetParent (m_hwnd, this - & gt; M_hWnd);
: : SetWindowPos (m_hwnd, HWND_TOP, rc. Left, rc, top, rc. The Width (), rc, Height (), SWP_FRAMECHANGED);
: : SetFocus (m_hwnd);
SetCursorPos (10, 10);//the menu 'View'
}
}
}



CodePudding user response:

Injected DLL is right, but not directly, but their newly built a child Windows Notepad, Edit the Edit box into your child window, you put the SetWindowPos or MoveWindow can be installed below the window

CodePudding user response:

In general is like this, as for the text color, close the window, the window changes size, and so on, is you window processing function
need some code?
  • Related