DoModal函式的執行過程

2021-07-02 15:19:50 字數 609 閱讀 2312

domodal函式的執行過程(這是我觀察mfc源**得出的結論)

1:載入對話方塊資源;

2:使父視窗失去焦點;

3:建立對話方塊視窗;

4:執行對話方塊的訊息迴圈;

5:退出訊息迴圈,隱藏對話方塊視窗(大小及位置:0,0, 0, 0);

6:使父視窗重新獲得焦點;

6:呼叫destroywindow銷毀對話方塊視窗。

7:釋放對話方塊資源。

// load resource as necessary

// disable parent (before creating dialog)

// create modeless dialog

// enter modal loop

// hide the window before enabling the parent, etc.

// destroy modal window

// unlock/free resources as necessary

其他的過程我不是很清楚,我想說的一點是domodal函式呼叫之後對話方塊的資源已經被釋放,不能再去訪問對話方塊的內容。如:訪問ccombobox控制項關聯的ccombobox變數的選項。

函式的執行過程

1.通過函式名字找到函式入口 2.給形參分配空間 3.傳值 4.執行函式體語句 5.返回,釋放空間。include void func char ptr int main int argc,char argv 讀者認為輸出的結果是什麼?輸出結果為 hello world 函式的本來意圖是讓字串從e往...

js 函式執行過程

函式執行過程中 1.每使用乙個變數,函式都會由近到遠的遍歷自己的好友列表中的作用域物件。2.如果在離自己近的格仔中找到了區域性變數,就優先使用區域性變數,不再去全域性找。3.如果在離自己近的格仔中沒找到要用的區域性變數,才被迫去全域性找,如果在全域性找到了想用的變數,則本次修改結果,會影響全部變數的...

python遞迴函式的執行過程

舉例 def nove n,a,b,c if n 1 print a,c else nove n 1,a,c,b nove 1,a,b,c nove n 1,b,a,c 執行輸出結果 nove 3,a b c a c a b c b a c b a b c a c 執行過程詳解 1 def nove...