Hook message | Program |
Special folder path | Program |
Program v system tray | Program |
ListExam | Program |
Hornφ a dolnφ index | Program |
GrabText | Program |
Tisk WYSIWYG | Program |
3D efekty | Program |
Informace o NT disku | Program |
CGI a Cookies | Modul, t°φda |
Jak schovat kurzor v TextBoxu | K≤d |
Export z Accessu do Excelu bez nainstalovanΘho Excelu | K≤d |
Jak zjistit, jestli b∞₧φ Word | K≤d |
V²pis telefonick²ch p°ipojenφ | K≤d |
Kontrola pravopisu pomocφ MS Wordu | K≤d |
Ukßzka pou₧itφ API funkce SetWindowsLong k obsluze zprßv. | |
7649 byt∙ | Kopφrovat |
Jak najφt cestu ke specißlnφm slo₧kßm systΘmu Windows, jako je nap°. Program Files, ukazuje tento p°φklad. | |
7172 byt∙ | Kopφrovat |
Program, kter² ukazuje jak umφstit ikonu programu do oblasti system tray na hlavnφm panelu a jak obsluhovat jeho menu. Jin² p°φklad z tΘto problematiky m∙₧ete nalΘzt i v Φßsti Otßzky a odpov∞di. | |
3283 byt∙ | Kopφrovat |
Ukazuje a porovnßvß rychlost vyhledßvßnφ a ruÜenφ duplicitnφch polo₧ek v ListBoxu r∙zn²mi metodami. | |
18797 byt∙ | Kopφrovat |
Jak ud∞lat na formulß°i a RichTextBoxu pφsmo s dolnφm indexem (stejn² zp∙sob lze pou₧φt i na hornφ) stejnΘ velikosti jako normßlnφ pφsmo. | |
1840 byt∙ | Kopφrovat |
Ukazuje, jak "vytßhnout" z jin²ch aplikacφ text a informace o oknech. | |
2397 byt∙ | Kopφrovat |
Jak nastavit RichTextBox pro tisk WYSIWYG (What You See Is What You Get). | |
11223 byt∙ | Kopφrovat |
Ukazuje, jak zachßzet s 3D objekty, zobrazovat je, stφnovat atd. | |
91446 byt∙ | Kopφrovat |
Program, kter² zjiÜ¥uje informace o vzdßlen²ch discφch na systΘmech s OS Windows NT Wosktation a Server. | |
15096 byt∙ | Kopφrovat |
Tento archφv obsahuje moduly a t°φdy pro prßci se skripty CGI a s cookies ve Visual Basicu. Auto°i uvßdφ, ₧e funkce v nich obsa₧enΘ pracujφ rychleji ne₧ p°i pou₧itφ jazyku PERL, pracujφ se vÜemi servery podporujφcφ CGI, podporujφ Netscape HTTP cookie specifikaci a mnoho dalÜφho. | |
9852 byt∙ | Kopφrovat |
Schovat kurzor v TextBoxu, nebo jinΘm prvku, m∙₧ete pomocφ API funkce HideCaret. Nejd°φve je t°eba vytvo°it pot°ebnΘ deklarace:
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _ (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal msg As Long, _ ByVal wParam As Long, ByVal lParam As Long) As Long Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function HideCaret Lib "user32" (ByVal hwnd As Long) As Long Public Const GWL_WNDPROC = (-4) Public Const WM_USER = &H400 Public Function NewWindowProc(ByVal hwnd As Long, ByVal msg As Long, _ ByVal wParam As Long, ByVal lParam As Long) As Long Const WM_RESERVED = &H100E Const WM_PAINT = &HF If msg = WM_PAINT Or msg = WM_RESERVED Then HideCaret hwnd NewWindowProc = CallWindowProc(OldWindowProc, hwnd, msg, wParam, lParam) End Function
SamotnΘ schovßnφ kurzoru se provede takto:
OldWindowProc = SetWindowLong(Text1.hwnd, GWL_WNDPROC, AddressOf NewWindowProc)
Hodnotu, kterou vracφ funkce SetWindowLong je dobrΘ si uschovat (zde do OldWindowProc), pokud byste cht∞li kurzor zase ukßzat.
Export z Accessu do Excelu bez nainstalovanΘho Excelu
Chcete-li vytvo°it Excelovsk² soubor jako export z databßze Access, nemusφte mφt nainstalovan² Excel. StaΦφ pouze ODBC ovladaΦe. Samotn² export je velice jednoduch²:
Public Sub VytvorExcel(ByVal soubor As String, ByVal verze As String, _ ByVal databaze As String, ByVal tabulka As String) Dim dbZdroj As Database Set dbZdroj = OpenDatabase(databaze) dbZdroj.Execute "SELECT * INTO " & tabulka & " " & _ "IN """"[Excel " & verze & ";DATABASE=" & soubor & ";] " & _ "FROM " & tabulka & " " dbZdroj.Close Set dbZdroj = Nothing End Sub
Funkce ExportExcel mß Φty°i parametry, soubor, kter² se mß vytvo°it, verze Excelu, zdrojovß databßze v Accessu a tabulka pro export. Pou₧itφ m∙₧e vypadat t°eba takto:
VytvorExcel "E:\novy.xls", "8.0", "E:\vyvoj\projekty\is.mdb", "pracovnici"
Tento tip nßs napadl jako odpov∞∩ na dotaz jednoho Φtenß°e. Ke zjiÜt∞nφ, zda b∞₧φ Word, se funkce WordBezi sna₧φ zφskat odkaz na b∞₧φcφ OLE server, tady Word (jde pou₧φt i na Excel apod.). Pokud je Word spuÜt∞n, operace prob∞hne v po°ßdku, jinak nastane chyba, kterß je odchycena.
Public Function WordBezi() As Boolean Dim myWord As Object On Error GoTo chyba WordBezi = True Set myWord = GetObject(, "Word.Application") Set myWord = Nothing Exit Function chyba: WordBezi = False End Function
Pokud chcete Word ukonΦit, staΦφ spustit metodu Quit objektu myWord:
myWord.Quit
Funkce TelPripojeni vracφ nßzvy vÜech telefonick²ch p°ipojenφ, nakonfigurovan²ch ve Windows. K tomu pou₧φvß API funkci RasEnumEntries.
Private Const cMAXENTRYNAME = 256 Private Type RASENTRYNAME dwsize As Long szentryname(cMAXENTRYNAME) As Byte End Type Private Declare Function RasEnumEntries Lib "RasApi32.dll" Alias "RasEnumEntriesA" _ (ByVal reserved As String, ByVal lpszPhonebook As String, lprasentryname As Any, _ lpcb As Long, lpcentries As Long) As Long Public Function TelPripojeni() As Variant Dim navrat As Long, kolik As Long, i As Long, phonebook As String Dim prip(cMAXENTRYNAME) As RASENTRYNAME, prip2() As String prip(0).dwsize = 264 navrat = RasEnumEntries(0, phonebook, prip(0), 256 * prip(0).dwsize, kolik) ReDim prip2(kolik - 1) For i = 0 To (kolik - 1) prip2(i) = StrConv(prip(i).szentryname, vbUnicode) Next i TelPripojeni = prip2 End Function
Pou₧itφ potom m∙₧e vypadat t°eba takto:
Dim a() As String, i As Long a = TelPripojeni For i = LBound(a) To UBound(a) List1.AddItem a(i) Next i
Kontrola pravopisu pomocφ MS Wordu
Pot°ebujete-li zkontrolovat pravopis, m∙₧ete s v²hodou pou₧φt mo₧nostφ, kterΘ nabφzφ Microsoft Office. Nßsledujφcφ funkce Pravopis vracφ zkontrolovan² text pomocφ Wordu. P°i kontrole, p°i nalezenφ neznßmΘho slova, se zobrazuje dialog z Wordu pro zßm∞nu slova za jinΘ.
Public Function Pravopis(ByVal txt As String) As String Dim wrd As Object Set wrd = CreateObject("Word.Basic") With wrd .FileNewDefault .Insert txt On Error Resume Next .ToolsSpelling .EditSelectAll wrd.SetDocumentVar "MojePromenna", wrd.Selection Pravopis = wrd.GetDocumentVar("MojePromenna") .FileClose 2 .AppClose End With Set wrd = Nothing End Function