VC sculptor small technology set (4)

zhaozj2021-02-16  42

VC sculptor small technology set (4)

He Zhidan

1. Reading procedures often look at this variable changes in those local values.

Ctrl f looks too much trouble

Plus this variable before CONST

Changed place to report

2, look at a function is called by those functions.

method:

1, under debugging, view-> debug window-> Call Stack

2. Select Called by Class View's shortcut menu

3, the leftmost display time in the status bar

Static uint indeicators [] =

{

ID_SEPARATOR, // We increase

ID_separator,

ID_indicator_caps,

ID_indicator_num,

ID_Indicator_scrl,

}

INT CMAINFRAME :: OnCreate (lpcreatestruct lpcreatestruct)

{

..... m_wndstatusbar.setpaneinfo (1, ID_separtor, sbps_normal, 60);

}

// menu response function

Void CMAINFRAME :: ontest ()

{

CTIME T;

T = CTIME :: getcurrenttime ();

CString str = T.Format ("% h -% m -% s");

M_WndStatusBar.SetPanetext (0, STR);

}

4, simulate mouse

:: setCursorpos ((int) PTMOUSE-> X, (int) PTMOUSE-> Y);

:: Mouse_Event (MouseEventf_leftdown, 0,0,0,0);

:: Mouse_Event (MouseEventf_leftup, 0,0,0,0);

:: Mouse_Event (MouseEventf_leftdown, 0,0,0,0);

:: Mouse_Event (MouseEventf_leftup, 0,0,0,0);

5, what is Word, DWORD

Typedef unsigned short word

Typedef unsigned long dword

6, mobile control

CWND * PWND = getDLGITEM (IDC_Button1);

CRECT R;

PWND-> GetWindowRect (& R);

R.LEFT = 50;

R.right = 50;

PWND-> MoveWindow (R);

7, how to make the CEDIT in the dialog response ENTER key to enter

Getdlgitem (IDC_EDit1) -> SetwindowText ("111 / R / N22");

Right click attribute

Sytle -> Multiline

It is best to choose Want Return.

8, transform C language into compilation

VC provides this feature.

Project-> settings ...

C / C Tab

Category: choose Listing Files

Listing File Type:

SELECT "Assembly with Source Code"

9, how to get the CPU time consumed by the process?

Bool getProcesstimes

Handle HProcess,

LPFileTime LPCREATIONTIME,

LPFileTime Lpexittime,

LPFileTime LPkernelTime,

LPFileTime lpusertime

);

10. How to get the icon corresponding to the extension by the extension?

SHGETFILEINFO (PATH,

ATR,

& sfi,

SizeOf (SHFILEINFO),

SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_TYPENAME); how to change the size of the border that is pulling the dialog box, letting it proportionally change. Just like video playback software

Handling WM_SIZING message

Void ctest 1dlg :: Onsizing (uint fwside, lprect prect)

{

CDIALOG :: Onsizing (fwside, prect);

IF ((fwside == wmsz_bottom) || (fwside == wmsz_top))

Prect-> Right = prect-> Left (prect-> bottom-prect-> TOP) * 2;

Else

Prect-> Bottom = prect-> top (prect-> right-prect-> left) * 0.5;

}

转载请注明原文地址:https://www.9cbs.com/read-25715.html

New Post(0)