Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
鉤子其實就是調用一下API而已:1、安裝鉤子: SetWindowsHookEx 函數原形:HHOOK SetWindowsHookEx( int idHook, // 鉤子類型, HOOKPROC lpfn, // 鉤子函數地址 INSTANCE hMod, // 鉤子所在的執行個體的控制代碼,
Time of Update: 2018-12-07
下面是我根據網路上的應用程式改編的一個簡單的托盤程式的DEMO,實現了一般托盤程式的準系統using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication4{ public
Time of Update: 2018-12-07
test.cs 資訊using System;using System.Collections.Generic;using System.Text;namespace testclass{ public class Class1 { public string GetName1() { return "Get the name!"; } public string GetName2(string name)
Time of Update: 2018-12-07
方法1:用c/c++自身的字串數組#include <string.h>void test(){ // 用法 1 - 1 char szInfo[100] = {0}; strcpy(szInfo, "hello, world\r\n"); printf(szInfo); // 用法 1- 2 char *pInfo = "hello, guys\r\n"; printf(pInfo); // 用法 1 - 3 char *
Time of Update: 2018-12-07
C++的引用C++中的引用可以看成是變數名稱的另一種說話,也看以看成是變數的外號,另一個名稱,取值方式 &int a = 100;int &aa = a;//定義一個int型的應用,他是變數a的引用在這裡,a、以及aa
Time of Update: 2018-12-07
這是看第2遍,看得比較仔細,筆記如下:函數調用在編譯期,會檢查實參與實參是否匹配。注意,其中可能的話,會發生隱式類型轉換,編譯器只是給出警告參數傳遞:預設情況是按值傳遞,實參的值拷貝到參數的儲存區。函數處理的是實參的拷貝按地址傳遞:引用和指標參數1. 函數需要改變實參2. 向函數傳遞大型物件時的效率考慮3.
Time of Update: 2018-12-07
原文見Nicholas Skapura得 Interfacing VB and C++VC++ DLL1)DLL中的函式宣告void __declspec(dllexport) CALLBACK TestFunc(){cout << "Inside the DLL!";}2)定義DEF檔案LIBRARY "testDLL_Library"DESCRIPTION "An example DLL for interfacing with C++"EXPORTSTestFunc
Time of Update: 2018-12-07
伺服器端:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.Text;using System.Net;using System.Net.Sockets;namespace UDPServer{ class Program
Time of Update: 2018-12-07
七、 編寫和顯示訂製的類型 屬性視窗中的編輯有如下三種工作方式:一,有些場合可以作為字串來編輯,然後由TypeConverter來實作類別型的轉換。二,可以顯示一個下拉式清單來選擇值。三,一個省略按鈕提供其他的UI介面來編輯值,比如FileDialog和FontPicker。我們已經講過了字串形式,接著我們就來看下拉式清單。 .NET framework已經包含了好幾種下拉式清單的例子,如Color,AccessibleRole,Dock等屬性。我們從可以看到下拉式清單的具體實現。 圖4.
Time of Update: 2018-12-07
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace WindowsApplication3{ public partial class
Time of Update: 2018-12-07
二部分組成,一個線程管理類ThreadManager,一個線程類MyThreadTest類是用來測試的 1.ThreadManager.cs using System;using System.Threading;using System.Collections;namespace CustomThreadPool{/// <summary>/// 線程管理器,會開啟或喚醒一個線程去執行指定的回調方法/// </summary>public class
Time of Update: 2018-12-07
C#的Enum設計的相關指導在網上有相關文章論述:英文:Design Guidelines Update: Enum Design中文:C# Idioms: Enum還是Enum Class(枚舉類) Enum的運算通常涉及到位元運算(AND、OR、XOR),按位元運算, 常使用FlagsAttribute 自訂屬性定義。FlagsAttribute 和 Enum 的準則:只有要對數值執行按位元運算(AND、OR、XOR)時才對枚舉使用 FlagsAttribute 自訂屬性。 用 2 的冪(
Time of Update: 2018-12-07
yield有兩種使用形式:yield return;和yield break;他們通常配合列舉程式對象IEnumerable(支援非泛型集合上進行簡單迭代)使用。yield return:即取到一個資料後馬上返回該資料,不需要全部資料裝入數列完畢,這樣有效提高了遍曆效率。普通的return只返回一個資料,yield return 可在迴圈中返回合格多個資料。yield break:在迴圈中,配合yield
Time of Update: 2018-12-07
//當前視窗寬度int iWidth = this.Width;//當前視窗高度int iHeight = this.Height;//截取主畫面Screen scrPrimary = Screen.PrimaryScreen;//建立一個和螢幕一樣大的BitmapImage myImage = new Bitmap(iWidth, iHeight);//從一個繼承自Image類的對象中建立Graphics對象Graphics graphi = Graphics.FromImage(myImag
Time of Update: 2018-12-07
原文地址(http://msdn.microsoft.com/zh-cn/library/ms173172(v=VS.90).aspx)委託是一種安全地封裝方法的類型,它與 C 和 C++ 中的函數指標類似。與 C
Time of Update: 2018-12-07
思路:①負數轉換為正數;例:-5,先轉換成5(0000 0101);第一位標識正負②先將十進位轉換為二進位通過;例:將5轉換為二進位,得到結果0000 0101③求反碼;例:將上面例子求反碼,得到結果:1111 1010(即0變成1,1變0)④求補碼;例:將第四步結果求補碼,得到結果:1111 1011(最後一位加1)⑤轉十六進位;1111
Time of Update: 2018-12-07
這是對C++高效編程的一個總結, 很有指導作用.一、#include “filename.h”和#include <filename.h>的區別#include “filename.h”是指編譯器將從當前工作目錄上開始尋找此檔案#include
Time of Update: 2018-12-07
1. 傳指標時,我們可以通過指標來修改它在外部所指向的內容。但如果要修改外部指標所指向的對象是不可能的。例如傳遞外部指標到函數內來分配空間,必須傳遞指標的指標或指標的引用。 2. char carry[10] = {0}; 編譯器會將其後所有的東西都置0; 3. 函數傳回值為const時,返回的東西付給一個類型相同的標示後其不能為左值; 4. const int *i; int const *i; int * const i;