Results 1 to 3 of 3

Thread: วิธีการcopyไฟล์ก่อกวนลงstartupด้วยCopyFile Function

  1. #1


    ในหัวข้อนี้มี Function ที่ต้องศึกษาอยู่ 2 ตัวครับมาดูกันเลย

    **Hidden Content: To see this hidden content your post count must be 2 or greater.**





  2. #2


    ตัวแรกชื่อว่า GetModuleFileName Function เป็น Function ที่ใช้ในการหา path ของไฟล์ครับ
    มาดูราละเอียดกัน
    DWORD WINAPI GetModuleFileName(
    __in HMODULE hModule,
    __out LPTSTR lpFilename,
    __in DWORD nSize
    );

    Parameters
    hModule
    A handle to the loaded module whose path is being requested. If this parameter is NULL, GetModuleFileName retrieves the path of the executable file of the current process.

    lpFilename
    A pointer to a buffer that receives the fully-qualified path of the module. If the length of the path exceeds the size that the nSize parameter specifies, the function succeeds, and the string is truncated to nSize characters and cannot be null terminated.

    The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and can use the prefix "\\?\". For more information, see Naming a File.

    nSize
    The size of the lpFilename buffer, in TCHARs.

    มัน จะรับ Parameters 3ตัวครับ ตัวแรกเค้าบอกว่าปล่อยเป็น NULL ได้ ตัวที่สองเป็น string ครับ ตัวที่สามเป็ขนาด อาจจะงง พอเห็นตัวอย่างก็จะเข้าใจครับ [/b]
    parameter ตัวแรก เขาไม่ได้บอกว่าให้ปล่อยเป็น NULL ได้ครับ เขาแค่บอกว่า ถ้าเป็น NULL จะได้ path ของ process ปัจจุบัน

  3. #3


    ที่ผมต้องบอกว่า ตัวแรกเค้าบอกว่าปล่อยเป็น NULL ได้ ก็เพราะว่าให้คนที่พึ่งจะเริ่มเขียนนำไปใช้ได้เลยครับไม่ต้องทำความเข้าใจมากมาย

    แต่ก็ขอบคุณที่เข้ามาทักท้วงครับ **ทีีหลังจะแปลตรงๆละกัน

Similar Threads

  1. undocumented API Function
    By pspn.n in forum C/C++,C#,VC++,MFC,Win32
    Replies: 1
    Last Post: 27-10-2008, 10:57 AM
  2. สอบถามเรื่อง Function
    By Verz in forum C/C++,C#,VC++,MFC,Win32
    Replies: 4
    Last Post: 16-10-2008, 09:33 PM
  3. php manual all function of php
    By popvip in forum PHP,ASP,Javascript, Html
    Replies: 0
    Last Post: 28-02-2008, 03:28 AM
  4. Network Function in C
    By conanjung in forum C/C++,C#,VC++,MFC,Win32
    Replies: 1
    Last Post: 17-11-2007, 03:30 PM
  5. Perl Function
    By windows98SE in forum Perl
    Replies: 0
    Last Post: 01-01-1970, 07:00 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •