| |
|
|
- Page 1 - |
|
Frank Abbing | Perhaps is so one Thread time nice. Someone asks a programming task and the rest trying to find a short and good solution... The best solution would be put to the code snippets.
My task for today is:
Find a short and fast Solution to determine, if a directory is empty or not! |
|
|
| |
|
|
|
| |
|
- Page 2 - |
|
Sebastian Sprenger | Jörg Sellmeyer
why do you even through the Lg(10) dividest. The is still 1 or? True, he is it? *ausprobier* Yes, he's. well to know. One can take the logarithm to a certain base (in my case 10) calculate, but if The Lg-function with 10 anyhow 1 outputs, kann's Yes omitted. |
|
|
| Profan² 7.0e, XProfan 9, 11.2a, FreeProfan32 Windows Vista Home Premium 32-Bit, 2.8 Ghz, 4 GB RAM Windows Me, 1.8 Ghz, 256 MB RAM | 08/29/08 ▲ |
|
|
|
| |
|
- Page 3 - |
|
|
Jörg Sellmeyer | Lg is the common logarithm. Correctly, the length a number:
Because it potentates the (so the power number) determined the power of the 10 is, to get the number: 10^0 = 1 10^0.nnnnn = Value betw. 1 and 9.9period 10^1 = 10 10^1.nnnnn = Value betw. 10.nnnn and 99.9period 10^2 = 100 10^2.nnnnn = Value betw. 100.nnnn and 999.9period 10^3 = 1000 10^3.nnnnn = Value betw. 1000.nnnn and 9999.9period ...
|
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 08/29/08 ▲ |
|
|
|
|
Frank Abbing | Nice try... |
|
|
| |
|
|
|
| |
|
| |
|
|
|
Frank Abbing | Please only Tasks, To them You yourself too a Solution know... |
|
|
| |
|
|
|
| Hey, You should still not insist that this not given is! |
|
|
| |
|
|
|
| So unfortunately I do not Solution to the bottom of the following task. Prehistory: Years ago, a voice recognition program called G-Vox, had instead of a Windows control to a round green thing with more or less versteckten Erhebungen, The at Mausklicken gelber get, itself verformten and at (zeitgefächerten) release each defined Options controlled (means kurzer, medium length and long click what effect different).
The thing could also apply to the Desktop-background as a rubber disc are rumgeschubst and was from the screen edges billardmässig reflects. All other Desktop-items were functionally (!), and in a certain mode, the important thing from even the mouse, if it was hidden, which one would click below. Intended design protection or something on it, but: The principle itself, namely how something not-rechteckiges over the Desktop functioning may move, would my interests.
Nostalgic background: i'd like my 3D-Papierflieger of snow anno over the Destop fly... Code of dunnemal attached. Greeting, woodpecker |
|
|
| |
|
|
|
Jörg Sellmeyer | there gibt's what Thomas Hölzer, what one could adapt:
$H windows.ph
$I profalt.inc
' PRFellow - Presentation
' shows, how to simulate a round window
' Author: Thomas Hölzer
' needs Profan 6.0 (32)
Def CreateEllipticRgn(4) !"GDI32","CreateEllipticRgn"
Def DeleteObject(1) !"GDI32","DeleteObject"
Def InvertRgn(2) !"GDI32","InvertRgn"
Def PaintRgn(2) !"GDI32","PaintRgn"
Def SetWindowRgn(3) !"USER32","SetWindowRgn"
Def Capture Release(0) !"USER32","ReleaseCapture"
Proc DrawTime
Declare t$
Rectangle 120,140-190,160
Let t$=time$(0);":";Left$(time$(1),2)
DrawText 120,140,t$
ENDPROC
'##################################
Proc Put
SetWindowPos %hwnd = (Rnd(%maxx -300) + 300),(Rnd(%maxy -300) + 300) - 300,300
ENDPROC
'###################################
Declare end%,rgn&,x%,move%
SetTrueColor 1
Window Style $78
Window Title "Rundes Fenster"
Window 0,0-300,300
User Messages 16
Let rgn&=CreateEllipticRgn(0,0,300,300)
SetWindowRgn(%hwnd,rgn&,1)
Cls RGB(0,0,255)
UseFont "Arial",20,0,0,0,0
UseBrush 1,RGB(0,0,255)
USEP 5,0,0
Text Color RGB(255,255,255),-1
DrawText 80,80,"Rechte Mouse button!"
DrawTime
SetTimer 1000
'#########################################
Var Timer& = ~SetTimer(%hwnd,1,1000,ProcAddr(Put,0))
'#########################################
WhileNot end%
WaitInput
Case %umessage = 16:Break
If %wmtimer
DrawTime
If move%
SetWindowPos %hwnd=x%,0-300,300
Add x%,10
Case Gt(x%,%maxX):Let x%=0
EndIf
EndIf
If Equ(%message,$204)
CreateMenu
AppendMenu 1, "&Invertieren"
IF move%
AppendMenu 2,"&Anhalten"
Else
AppendMenu 2, "B&ewegen"
EndIf
AppendMenu 3,"&Farbe ändern"
Separator
AppendMenu 4,"&Beenden"
TrackMenu %MouseX,%MouseY
If MenuItem(1)
InvertRgn(%hdc,rgn&)
Elseif Menuitem(2)
Let move%=hardship(move%)
ElseIf MenuItem(3)
Randomize
' with Region-function:
' UseBrush 1,RGB(Rnd(256),Rnd(256),Rnd(256))
' PaintRgn(%hdc,rgn&)
' The course also tuts...
Cls RGB(Rnd(256),Rnd(256),Rnd(256))
DrawTime
ElseIf MenuItem(4)
Let end%=1
Endif
Elseif Equ(%message,$201)
UseCursor 5
Sendmessage(%hwnd,$0112,$0F012,0);
UseCursor 0
Capture Release()
EndIf
Wend
KillTimer
'#####################
~KillTimer(%hwnd,Timer&)
'#####################
SetWindowRgn(%hwnd,0,0)
DeleteObject(rgn&)
End
Nice airplane! |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 09/09/08 ▲ |
|
|
|
|
| |
|
| |
|
|
|
| Must first learn times, what do the ~-Dinger... Please where can I get profalt.inc ? (Search in the Profan-directory and here unfortunately negative...)
1. appendix: This sounds with round windows ever quite well ... 2. appendix: WOW, is Windows itself can already? Dammit, I will still API-friend... 3. appendix: Hey, I've created a Triangular window! --> Schneekönig!!! thanks! |
|
|
| |
|
|
|
Jörg Sellmeyer | and CombineRgn can one still different forms join. The Profalt.inc You do not need, since the functions in XProfan10 Add, Sub u.s.w. still function. ex 11 Operators are only permitted.
The ~-pair (called incidentally Tilde) lead a substitute terms, external from a file (here Window.ph) the actual values/Funktionsnamen o.ä. be read. ~KillTimer(...) is then for External("User32","KillTimer",....) Look under Header-Files to. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 09/10/08 ▲ |
|
|
|
|
| Hi, I had too a small task for you, is one little schwerer, and of course there's under windows 7 so a function where one einstellt in whom mode the computer straight runs (is in the Systemtray). there's there whom Energiesparmodus and the Hochleistungmodus. my question moreover sounds can with XProfan one Program write what autommatisch into Moden changes, d.h. if z.B. The CPU-Use niedriger as 50 is changes it into Energiesparmodus and as they higher is into Höchsleistungsmoodus oderr so. best would naturally if the program in background walk would or only Systemtray To see would? Well vlt falls you Yes ne Solution one or, it would Real very useful if it automatically into Moden weckseln would!!!!
mfg
Julian57 |
|
|
| |
|
|