Code: Select all
/////////////////////////////////////////////
// clock.c - analog clock panel example
// requires WINDOWS VISTA or above
// (c) jcl / oP group 2009
/////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
var hours;
// drag window with left mouse button
function on_mouse_left_event()
{
VECTOR click_pos,new_pos;
vec_set(click_pos,mouse_cursor);
// move the window by the mouse distance to the click position
while (mouse_left) {
vec_diff(new_pos,mouse_cursor,click_pos);
vec_add(new_pos,window_pos);
video_window(new_pos,NULL,0,0);
wait(1);
}
}
// draw a halftransparent border for a sort of antialiasing
void bmap_drawborder(BMAP* bmap,COLOR* color,var alpha)
{
var pixel = pixel_for_vec(color,alpha,bmap_lock(bmap,0));
var width = bmap_width(bmap);
var height = bmap_height(bmap);
var i;
for (i=0; i<width; i++) {
pixel_to_bmap(bmap,i,0,pixel);
pixel_to_bmap(bmap,i,height-1,pixel);
}
for (i=0; i<height; i++)
{
pixel_to_bmap(bmap,0,i,pixel);
pixel_to_bmap(bmap,width-1,i,pixel);
}
bmap_unlock(bmap);
}
////////////////////////////////////////////////////////////
#define COLOR_HAND vector(255,220,220)
#define COLOR_BODY vector(20,0,0) // dark blue
function main()
{
vec_set(screen_size,vector(400,400,0));
vec_set(screen_color,COLOR_BODY);
if (sys_winversion >= 6)
video_alpha = 85; // transparency works under Vista only
wait(1); // wait until the engine window is opened
// place the clock in the upper left corner
video_window(vector(6,6,0),vector(200,200,0),2,0);
PANEL* clock = pan_create(NULL,0);
set(clock,SHOW);
BMAP* hours_hand = bmap_fill(bmap_createblack(140,8,32),COLOR_HAND,100);
bmap_drawborder(hours_hand,COLOR_HAND,60);
pan_setneedle(clock,0,screen_size.x/2,screen_size.y/2,
hours_hand, 10,4,90,12,0,hours);
BMAP* minutes_hand = bmap_fill(bmap_createblack(180,6,32),COLOR_HAND,100);
bmap_drawborder(minutes_hand,COLOR_HAND,60);
pan_setneedle(clock,0,screen_size.x/2,screen_size.y/2,
minutes_hand,10,3,90,60,0,sys_minutes);
BMAP* seconds_hand = bmap_fill(bmap_createblack(190,5,32),COLOR_RED,100);
bmap_drawborder(seconds_hand,COLOR_RED,60);
pan_setneedle(clock,0,screen_size.x/2,screen_size.y/2,
seconds_hand,20,2,90,60,0,sys_seconds);
// add inbetween value for hour hand
while(1) {
hours = sys_hours + sys_minutes/60;
wait(1);
}
}
i have tested with enigma demo 1.76,tested to protect the file without any pluggins,just default setting,when i run the protected exe,after the demo splash,nothing appear,the protected app just shutdown
,the project file attached below,btw iam running win xp pro sp2 64 bit.